如何在IIS Express中引用本机文件? [英] How do I reference native files in IIS express?
问题描述
我所拥有的是Asp.Net MVC项目,该项目引用了c ++ / cli程序集,而c ++ / cli程序集又引用了一些本机c ++ dll。这最终是以网络角色发布的天蓝色网络服务。
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.
这建议将本机dll复制到启动任务中的%windir%\system32 \inetsrv文件夹中,以便Web角色可以在角色启动时找到它们。这在云上可以正常工作。
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.
但是在本地调试时我希望这些dll可用于IIS Express。这些是64位dll所以我必须运行64位版本的IIS express。我试图计算IIS Express 64位的等效%windir%\system32 \inetsrv。
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.
推荐答案
As事实证明,问题是%windir%。
As it turns out, the problem was %windir%.
在64位机器上,当运行32位进程时,它会重定向到SysWoW64。
On the 64 bit machine, this redirects to SysWoW64 when running a 32 bit process.
由于VS是32位,启动任务从VS内部作为32进程运行,文件被复制到错误的目录。
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.
使用%windir%\ Sysnative 否则解决了完整IIS的问题。
Using %windir%\Sysnative when working from VS and %windir% otherwise solves the issue for full IIS.
对于IIS表示要复制到的正确目录是C:\Program Files \ IIS Express
For IIS express the correct directory to copy to is "C:\Program Files\IIS Express"
这篇关于如何在IIS Express中引用本机文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!