Last post Jul 15, 2013 05:19 AM by cwt237
Jul 05, 2013 04:42 AM|cwt237|LINK
I am having an issue loading a managed C++ assembly with unmanaged C (native) dependencies.
My question is whether ASP.NET / IIS will attempt to resolve the C/C++ runtime from WinSxS?
If yes, what is the search order?
The shadow copy will ensure that we are working from one of the temporary asp.net folders in e.g. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\... but I am not sure when the WinSxS is scanned (or if it is scanned at all).
Can this be disabled?
My ASP.NET (MVC 4) app is referencing a managed C++ assembly called managed.dll. This assembly is referencing CRT (C/C++ runtime) using:
However, the same assembly has another dependency to a C native dll, which also has a dependency to the C runtime (again shown as msvcr80.dll in Dependency Walker). Apparently IIS will not resolve that correctly, even though it works out of the box in a
Using dependency walker I can see the two references - showing full paths. reveals that they are picked up from different locations. One is a local file in the bin folder, the other is the one from WinSxS.
I have tried modifying the Microsoft.CRT.manifest file to remove publicKeyToken and hash values, but that did not have any effect.
My theory is that if I can get Dependency Walker to pick up the same file (e.g. by using manifest files or similar), I can get it to work in ASP.NET too.
Jul 11, 2013 10:31 PM|Angie xu - MSFT|LINK
but I am not sure when the WinSxS is scanned (or if it is scanned at all).
For this issue, I think you could learn that from what the the WinSxS is and the mechanism of WinSxS,
Side-by-side technology is also known as WinSxS or SxS, although technically WinSxS refers only to the global side-by-side store (officially called the "Windows component store"), which is conceptually the native equivalent of the .NET Global Assembly Cache.
Executables that include an SxS manifest are designated SxS assemblies.
And Operating system files in the WinSxS directory are hard linked to their usual locations in the Windows directory structure. The same file may be linked from a directory in WinSxS and from, say, the System32 directory,
# Side-by-side assembly -
At the same time you can also learn how to build C/C++ isolated applications and Side-by-side assemblies, it will be helpful for us to understand it better,
# Building C/C++ Isolated Applications and Side-by-side Assemblies
hope it helps you,
Jul 15, 2013 05:19 AM|cwt237|LINK
Thanks for the info.
I have looked into the links provided, but I am still failing to figure out the difference between resolving dependencies in IIS and outside IIS. There is clearly a difference.
Working with 3rd party dependencies seems to be a hassle too - since I don't have the possibility to just flick some settings on the dependencies and recompile them.
No solution has been found yet (besides the work around), but the task is shelved right now, and I pick it up once in a while to take a new look at it.