问题
What I have is a Asp.Net MVC project which references a c++/cli assembly which in turn references some native c++ dlls. This is ultimately published ta a azure web service in a web role.
This recommends copying the native dlls to the "%windir%\system32\inetsrv" folder in a startup task so that web role can find them when the role starts up. This works as expected on the cloud.
However when debugging locally I want these dll's available to IIS Express. These are 64 bit dlls so I have to run the 64 bit version of IIS express. I am trying to figure what the equivalent of %windir%\system32\inetsrv for IIS Express 64 bit.
回答1:
As it turns out, the problem was %windir%.
On the 64 bit machine, this redirects to SysWoW64 when running a 32 bit process.
Since VS is 32 bit the startup task runs as a 32 process from within VS and the files get copied to the wrong directory.
Using %windir%\Sysnative when working from VS and %windir% otherwise solves the issue for full IIS.
For IIS express the correct directory to copy to is "C:\Program Files\IIS Express"
回答2:
Can Copy Local not be set on the properties of the reference so that the dll gets copied locally on deploy/debug? Unless I'm missing something this should allow IIS to figure out where it needs to be.
来源:https://stackoverflow.com/questions/24246547/how-do-i-reference-native-files-in-iis-express