Showing results for 
Search instead for 
Did you mean: 

Embed Interop Types / COM macro / dll hell ;)

Valued Contributor
Valued Contributor

Hello everybody,


I need some basic opinions / proofed workarounds about embed interop types,

as I have got an issue here and I'm not very experienced with the interops...



I have got some exe macros and all of them are compiled with

"Embed Interop Types" = False


Should it basically be false or can we use true?


As I found out that I have got some old exes that are just compiled with an old SE version,

and some new ones, AND all of the programs are in one folder ( maybe basically a bad idear Smiley Wink )

If I overwrite the interops for example ...Framework.dll

the old exes won't run, but

I have to, because there are things which doesn't work on new exes...


^^ so I guess I have to compile the complete package ...

but as I'd like to even learn something from your opinions please reply Smiley Wink



Posted by: Linus Hechinger
Post date: 1/25/2013 5:29:08 AM


Embed Interop Types / COM macro / dll hell ;)

Valued Contributor
Valued Contributor

I can't remember the exact reason, maybe RD will jump in here and remind us, but there is something in particular that does not work correctly when embedding interops. I was super excited about the functionality when it came out only to hit the roadblock and haven't revisited the issue since.


I'm a little curious as to why the older .exe's won't run with the newer Interop.dll's. My suspicion is that the old stuff is built for an older version of the CLR and the new stuff is built for the latest version of the CLR. Take a look at [url=].NET Framework Versions and Dependencies[/url]. Specifically, and I quote MSDN:


[quote]The .NET Framework versions 2.0, 3.0, and 3.5 are built with the same version of the CLR (CLR 2.0). These versions represent successive layers of a single installation. Each version is built incrementally on top of the earlier .NET Framework versions. It is not possible to run versions 2.0, 3.0, and 3.5 side by side on a computer. When you install the .NET Framework 3.5 SP1, you get the 2.0 and 3.0 layers automatically. However, the .NET Framework 4 ends this layering approach. Starting with the .NET Framework 4, you can use in-process side-by-side hosting to run multiple versions of the CLR in a single process. Apps that were built for versions 2.0, 3.0, and 3.5 can all run on version 3.5, but they will not work on version 4 or later.[/quote]


So if this is the case, you have two options:


[li]Run the old and new apps in separate folders with their respective Interop.dll's.[/li]

[li]Build all apps to a common version of the CLR and place in single folder.[/li]





Posted by: Jason Newell
Post date: 1/25/2013 6:15:57 PM