I have two different versions of an unmanaged dll and a manifest for each. In my C# code, I use activation contexts to control which one is used. I'm then using P Invoke to do the actual call. It appears that the creation and activation of the activation context is successful. However, the context seems to be ignored and whichever dll gets called first is used by both.
Can P Invoke be used with SxS? Or have I set this up incorrectly?
My definition for the C function in the C# code is:
[DllImport("MyMath.dll")]
private static extern double Add(double a, double b);
My manifest just has the assembly identity that I added, and the trustInfo that Visual Studio 2010 generated.
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity name="MyMath.dll"
version="1.1.0.0"
type="win32"
processorArchitecture="x86"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Thank you for your help.
-Nick