Red Gate forums :: View topic - Diff inbuild from Visual Studio / vs SmartAssembly interface
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Diff inbuild from Visual Studio / vs SmartAssembly interface

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
robbertdam



Joined: 12 Oct 2012
Posts: 5

PostPosted: Fri Oct 12, 2012 10:43 am    Post subject: Diff inbuild from Visual Studio / vs SmartAssembly interface Reply with quote

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 20052012
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
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Mon Oct 15, 2012 10:24 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
robbertdam



Joined: 12 Oct 2012
Posts: 5

PostPosted: Mon Oct 15, 2012 10:43 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Mon Oct 15, 2012 1:52 pm    Post subject: Reply with quote

Crashes? Please explain...
Back to top
View user's profile Send private message
robbertdam



Joined: 12 Oct 2012
Posts: 5

PostPosted: Mon Oct 15, 2012 3:32 pm    Post subject: Reply with quote

I will try to be more clear:

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

Code:
<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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Wed Oct 17, 2012 4:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Wed Oct 24, 2012 2:58 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group