简体   繁体   English

创建目录(在网络驱动程序上)抛出在IIS上运行的错误

[英]Create directory (on network driver) throw an error wile runing on IIS

I am using asp.net mvc 5 with c#. 我正在使用带有c#的asp.net mvc 5。 The app needs to create a folder in the server when certain action occur. 当某些操作发生时,应用程序需要在服务器中创建一个文件夹。

The folder has to be created in one network drive. 必须在一个网络驱动器中创建该文件夹。 All this works properly when the app is running in visual studio, however, doesn't work on IIS. 当应用程序在visual studio中运行时,所有这些都能正常工作,但是在IIS上不起作用。

My guess is that the IIS does not have enough permissions, so i try to change the app pool identity, but the result wat the same. 我的猜测是IIS没有足够的权限,所以我尝试更改应用程序池标识,但结果是相同的。

Edited 编辑

One thing that could not help is that the network drive was created in the software in the server (QNAP server), not in windows. 有一点无法帮助的是网络驱动器是在服务器(QNAP服务器)中的软件中创建的,而不是在Windows中创建的。

How can i make IIS behave like visual studio ? 我怎样才能使IIS像visual studio一样?

How about you create a virtual directory that maps to the nas share folder. 如何创建映射到nas共享文件夹的虚拟目录。 Here are a few steps. 这是几个步骤。

  1. In IIS on your site right click and do "Add Virtual Directory" 在您网站上的IIS中右键单击并执行“添加虚拟目录”
  2. In the dialog that pops up give some alias name and in the physical path enter the location to share folder. 在弹出的对话框中提供一些别名,并在物理路径中输入共享文件夹的位置。
  3. Click the connect as button. 单击“连接为”按钮。 In the pop up select specific user and then enter the credentials. 在弹出选择特定用户,然后输入凭据。

Now from your code you access virtual directory. 现在从您的代码中访问虚拟目录。

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM