DirectoryNotFoundException:找不到路径N:\ test的一部分 [英] DirectoryNotFoundException: Could not find a part of the path N:\test
问题描述
我们已按以下方式映射NAS的文件系统:
C:\Users \Administrator> net use
将记住新的连接。
状态本地远程网络
--------- -------------------------------------------------- --------------------
OK N:\\192.168.10.100\NAS_VOL_08 Microsoft Windows网络
$ / b $ b
同样在通过Visual Studio 2010进行调试时工作但在IIS 7.0上托管后无法工作
我们正在使用.Net framework 4.0
请帮助...
We have mapped filesystem of NAS in the following manner:
C:\Users\Administrator>net use
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
OK N: \\192.168.10.100\NAS_VOL_08 Microsoft Windows Network
same is working while debugging through Visual Studio 2010 but not working after hosting on IIS 7.0
we are using .Net framework 4.0
Kindly help...
推荐答案
在IIS 7上托管时什么不起作用?
映射驱动器?这很简单。默认情况下,您的网站在服务帐户下运行,该服务帐户无权共享以将驱动器映射到该网站。
更改应用程序池以运行为一个拥有该共享权限的用户帐户。
当您只使用UNC路径时,甚至不需要映射驱动器。
WHAT isn't working when hosting on IIS 7?
Mapping the drive? That's easy. Your website, by default, is running under a service account which will not have permissions to the share to map a drive to it.
Change the Application Pool to run as a user account that has permissions to the share.
You don't even need a mapped drive when you can just use the UNC path instead.
可能是您使用提升的进程挂载驱动器并尝试使用非提升的进程访问它的原因,反之亦然。
Could be the reason that you mounted the drive with elevated process and trying to access it with non-elevated process or vice versa.
这篇关于DirectoryNotFoundException:找不到路径N:\ test的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!