Red Gate forums :: View topic - Application crashes at start-up after obfuscation
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

Application crashes at start-up after obfuscation

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



Joined: 01 Jul 2013
Posts: 3

PostPosted: Mon Jul 01, 2013 4:37 am    Post subject: Application crashes at start-up after obfuscation Reply with quote

We've been using SA for many years and it was problem free experience.
Our app is .Net 4.0 based. Recently we had .Net 4.5 installed on the build PC and ran into a problem.

After obfuscation application starts just fine on the build PC but crashes at start-up on any other computer. The problem is caused by SmartAssembly, because if obfuscation is turned off the app launches just fine on other PCs as well.

So I tried to play with SA's project setting and turned off all optimizations except resigning obfuscated assembly with .snk key. It didn't help the app still crashes on all computers except the build PC.

Here is the error I'm receiving.
AppName: appname.exe AppVer: 6.9.7.0 AppStamp:51d0944a
ModName: kernel32.dll ModVer: 5.1.2600.6293 ModStamp:506bc5e5
fDebug: 0 Offset: 00012fd3

What can be done to troubleshoot this problem?

We use SA 6.6.4.95

PS: Unfortunately uninstalling .Net 4.5 is not an options since it's required by TFS 2013 server

Thanks
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 235

PostPosted: Wed Jul 03, 2013 12:00 am    Post subject: Reply with quote

Thanks for your post and sorry to hear you're running into some trouble with SmartAssembly!

Just to confirm--if the app has obfuscation turned off but you still build it through SmartAssembly (with no options enabled), does that build run on other machines without crashing?

I'm also curious.. is .NET 4.5 installed on any of the other machines you've tested on?
_________________
Jessica Ramos
Technical Support
Red Gate Software Ltd.
Back to top
View user's profile Send private message
YurySG



Joined: 01 Jul 2013
Posts: 3

PostPosted: Fri Jul 12, 2013 9:49 pm    Post subject: Re: Reply with quote

jessica.ramos wrote:
Thanks for your post and sorry to hear you're running into some trouble with SmartAssembly!
Just to confirm--if the app has obfuscation turned off but you still build it through SmartAssembly (with no options enabled), does that build run on other machines without crashing?

It happens with all the obfuscations turned off. The only option shown "green" in SmartAssembly is Generate Debug Info. All other options are turned off "yellow".

jessica.ramos wrote:
I'm also curious.. is .NET 4.5 installed on any of the other machines you've tested on?

Yes, .Net 4.5 is installed. Our application is targeting .Net 4.0.

This is becoming a showstopper for us, please advise what we should do next.
Back to top
View user's profile Send private message
rs



Joined: 12 May 2010
Posts: 11

PostPosted: Sun Jul 21, 2013 10:51 pm    Post subject: Reply with quote

We too have hit this problem I think, when we upgraded our build server to use VS 2012 - in our case our obfuscated .exe starting failing to run on machines with .NET 4.0 and not .NET 4.5 installed. The problem that manifests is this one:
http://stackoverflow.com/questions/10896894/webapi-rc-system-runtime-compilerservices-extensionattribute-from-assembly-ms

.. the unobfuscated assemblies work fine so VS is building assemblies with the correct target framework version. Seems to me likely that SmartAssembly is picking up .NET assemblies from the .NET framework folder (which is .NET 4.5 where some types have been moved around) and not the .NET reference assembly folder when building.

Can I tell SmartAssembly that it should always look in the reference assemblies path when building the "SmartAssemblyfied" version of our assemblies?
Back to top
View user's profile Send private message
YurySG



Joined: 01 Jul 2013
Posts: 3

PostPosted: Mon Jul 22, 2013 1:10 am    Post subject: Reply with quote

With help of a very helpful lady from the support we have been able to find the cause of the problem. SA is very sensitive to the version of reference assemblies that are used during obfuscation and when you run your application.

Basically what was happening is that during obfuscation version 9.0.XXX of a reference assembly was used. But the installation of the application contained version 9.0.YYY of reference assemblies. Apparently that's what was causing crashes.
Back to top
View user's profile Send private message
Soyin



Joined: 27 Aug 2013
Posts: 1

PostPosted: Tue Aug 27, 2013 9:29 pm    Post subject: Re: Reply with quote

YurySG wrote:
With help of a very helpful lady from the support we have been able to find the cause of the problem. SA is very sensitive to the version of reference assemblies that are used during obfuscation and when you run your application.

Basically what was happening is that during obfuscation version 9.0.XXX of a reference assembly was used. But the installation of the application contained version 9.0.YYY of reference assemblies. Apparently that's what was causing crashes.


Can you share the solution with the rest of us?

We are having this issue as well. In my case, the application is being built with with the .net 4.0 reference assemblies and works as expected when it's not obfuscated. After running it through obfuscation, it no longer runs and gives an error about a missing type which was added in .net 4.5. Is there a way to tell SmartAssembly to use the dlls from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0?

Thanks!
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