I have a native code app that uses COM/.NET Interop to a managed code assembly exposed as a COM object. Previously this was using the registry but I thought I'd explore using reg free COM. This is working correctly when the COM assembly is installed to the
same location as the application. I was also looking to see whether the same assembly can be located in the GAC. The Sxs probing seems to search the old 2.0 GAC (\windows\assembly\GAC) folder but not the .NET 4 location (\windows\microsoft.net\assembly).
So, if the .NET component has been built and GAC'd using .NET 2,3 or 3.5 the application works, but if targeted at .NET 4.0 the infamous application failed to start message appears. The sxstrace tool seems to confirm that the .NET 4 GAC is not searched and
Curiously, if I start the application with the local assembly such that the application context succeeds, then *delete* the local file, the application continues to work and the assembly is loaded from the 4.0 GAC.
Ultimately the .NET assembly is likely to be installed locally, but I'm interested if anyone can explain the behaviour I'm seeing and whether sxs/GAC is something to be avoided?
View Complete Post