How do I reference native files in IIS express?

非 Y 不嫁゛ 提交于 2019-12-11 07:08:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!