Problem with embedding interop types
Roger Billsdon
Posts: 14
Hi all
Since my previous posts I've encountered further problems when programs that use COM interop are obfuscated with SmartAssembly.
After a lot of further trial and error experimentation I now believe these problems arise when COM interop types are embedded in the assembly. In my case I'm using Visio and so far my testing suggests that all the "Specified cast is not valid System.StubHelpers.InterfaceMarshaler.ConvertToNative" errors can be avoided if in my program project properties the Microsoft.Office.Interop.Visio "Embed Interop Types" is changed from True to False. I got the idea to try this from: http://blogs.msdn.com/b/jmstall/archive ... lr-v4.aspx
However, this work-around causes significant problems because, for example, embedding interop types allows programs to work with multiple versions of the Micrososoft Office programs (eg see http://msdn.microsoft.com/en-us/library/dd409610.aspx)
Is there any chance SmartAssembly can be made to work with embedded interop types?
Best regards
Roger Billsdon
Since my previous posts I've encountered further problems when programs that use COM interop are obfuscated with SmartAssembly.
After a lot of further trial and error experimentation I now believe these problems arise when COM interop types are embedded in the assembly. In my case I'm using Visio and so far my testing suggests that all the "Specified cast is not valid System.StubHelpers.InterfaceMarshaler.ConvertToNative" errors can be avoided if in my program project properties the Microsoft.Office.Interop.Visio "Embed Interop Types" is changed from True to False. I got the idea to try this from: http://blogs.msdn.com/b/jmstall/archive ... lr-v4.aspx
However, this work-around causes significant problems because, for example, embedding interop types allows programs to work with multiple versions of the Micrososoft Office programs (eg see http://msdn.microsoft.com/en-us/library/dd409610.aspx)
Is there any chance SmartAssembly can be made to work with embedded interop types?
Best regards
Roger Billsdon
Comments
Redgate Software
http://downloads.red-gate.com/EAP/Smart ... 131171.exe