Application crashes at start-up after obfuscation
YurySG
Posts: 5 Bronze 1
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
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
Comments
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 | Product Support Engineer | Redgate Software
Have you visited our Help Center?
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.
http://stackoverflow.com/questions/1089 ... ssembly-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?
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!