Diff inbuild from Visual Studio / vs SmartAssembly interface

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

Diff inbuild from Visual Studio / vs SmartAssembly interface

Postby robbertdam » Fri Oct 12, 2012 10:43 am

Hi all,

I have integrated the SmartAssembly obfuscation into my VS2012 project by following the instructions on the Red Gate website. However, I now run into the strange situation where the output of the build from Visual Studio is different from the output of the build from the SmartAssembly user interface.

The SmartAssembly task in Visual Studio gives the following errors:

SmartAssembly v6.7.0.239
10> Copyright © Red Gate Software 2005–2012
10> Loading project EasyFit.saproj
10> Loading...
10> Starting...
10> Analyzing...
10> Preparing...
10> Error rewriting xaml for resources/glowbutton.baml:
10> Object reference not set to an instance of an object.
10> Error rewriting xaml for windows/iprofilerimportwindow.baml:
10> Object reference not set to an instance of an object.
10> Error rewriting xaml for windows/nodatabaseconnectionwindow.baml:
10> Object reference not set to an instance of an object.
10> Error rewriting xaml for controls/lenspanel.baml:
10> Object reference not set to an instance of an object.

...and a lot more lines
robbertdam
 
Posts: 5
Joined: Fri Oct 12, 2012 9:59 am

Postby Brian Donahue » Mon Oct 15, 2012 10:24 am

Hi,

The last successful fix for this issue was to clean the build in VS and then rebuild all. It was something to do with a third-party control and code signing. Although I don't have specifics about why this solved the problem, it may be worth a try.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby robbertdam » Mon Oct 15, 2012 10:43 am

I tried to clean the build first, but the problem remains.

Additional note: If I run obfuscation right from Visual Studio 2012, the resulting build crashes on startup. If I run obfuscation from outside Visual Studio, using the SmartAssembly user interface, the build is ok.
robbertdam
 
Posts: 5
Joined: Fri Oct 12, 2012 9:59 am

Postby Brian Donahue » Mon Oct 15, 2012 1:52 pm

Crashes? Please explain...
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby robbertdam » Mon Oct 15, 2012 3:32 pm

I will try to be more clear:

When I include the .saproj in the Visual Studio as follows:

Code: Select all
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
    <SmartAssembly.MSBuild.Tasks.Build ProjectFile="EasyFit.saproj" />
  </Target>


And build my project, the resulting executable gives an unhandled exception at startup (see below for details of this exception).

When I open this same .saproj in SmartAssembly and build, this exception does not occur when starting the resulting executable.

The obfuscated executable is written in a seperate folder, which is a subdir of the bin\\Release folder. Obfuscation and assembly merging is applied.

It's an "System.Windows.Markup.XamlParseException" exception with the following message: "Cannot find type 'Type Name'. The assembly used when compiling might be different than that used when loading and the type is missing."

It occurs in "XamlReader.LoadBaml". So the exception appears to be related to the error messages I see in MSBuild: "Error rewriting xaml for resources/glowbutton.baml"..etc.
robbertdam
 
Posts: 5
Joined: Fri Oct 12, 2012 9:59 am

Postby Brian Donahue » Wed Oct 17, 2012 4:21 pm

I'm mystified for two reasons - one, SmartAssembly is providing inadequate information to track down what the problem is, and two, why would it work through the UI and not the command line when it is using exactly the same code?

Is it possible that the .saproj exists in two different locations, and one is an outdated .saproj? Possibly, specifying the full path to the project file in the build script would help rule that out.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby james.billings » Wed Oct 24, 2012 2:58 pm

Hi,
I've checked the problem you describe with our development team and it sounds like something that may well be resolved in a patch build - could you try the patch available here and see if it fixes what you're seeing?
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests