A colleague and I had an interesting problem this afternoon with running a .NET executable we had created from within a Wise authored MSI. Basically the exe collected some values from a custom form and did some processing on them. The exe had a reference to an assembly that contained some functionality we needed so didn't think twice about adding a reference to it.
However the MSI would bomb out with a missing file exception to the referenced assembly. The console window that popped up showed the exe was extracted and copied to C:\Windows\Install (hidden folder) and executed there - obviously the referenced assembly was nowhere in sight.
A bit of rummaging around on Google and came across this life-saver on how you can implement an assembly resolver to load an assembly you have added as an embedded resource to your exe once the usual assembly locations have been searched by the framework and turned up empty.
There are a few issues with it if you read the comments but it saved my bacon on a 10 line installer utility app so it'll do for me - it's gone into the toolbox for future use that's for sure - thanks Jerry!
However the MSI would bomb out with a missing file exception to the referenced assembly. The console window that popped up showed the exe was extracted and copied to C:\Windows\Install (hidden folder) and executed there - obviously the referenced assembly was nowhere in sight.
A bit of rummaging around on Google and came across this life-saver on how you can implement an assembly resolver to load an assembly you have added as an embedded resource to your exe once the usual assembly locations have been searched by the framework and turned up empty.
There are a few issues with it if you read the comments but it saved my bacon on a 10 line installer utility app so it'll do for me - it's gone into the toolbox for future use that's for sure - thanks Jerry!
Comments
Glad to see that helped. Like you mentioned, and as the comments to the post point out, it's not a perfect solution, but it isn't meant to be.
-Jerry
http://weblogs.asp.net/jdennany