简体   繁体   English

在Visual Studio 2015中通​​过映射的网络驱动器创建和加载ASP.NET项目失败

[英]ASP.NET project creation and loading failure in Visual Studio 2015 over mapped network drive

Firstly the solutions I have found yet in various websites, are for older Visual Studio versions. 首先,我在各种网站中找到的解决方案是针对较旧的Visual Studio版本的。

My configuration is: 我的配置是:

  • Visual Studio 2015 installed in Windows 10 virtual machine ( VMware ) Windows 10虚拟机VMware )中安装的Visual Studio 2015

  • A shared folder which is treated as a network drive and mapped as Z:\\ in the VM 在VM中被视为网络驱动器并映射为Z:\\的共享文件夹

What I can do successfully: 我能成功完成的工作:

  • Creation, loading and debugging Visual C# Windows Forms Application in the network drive in the VM 在VM的网络驱动器中创建,加载和调试Visual C#Windows Forms应用程序

  • The same above for Visual C# ASP.NET Web Application but only in a local drive 上面对于Visual C#ASP.NET Web应用程序相同,但仅在本地驱动器中

What I cannot do successfully: 我无法成功完成的工作:

  • Creation, loading and debugging Visual C# ASP.NET Web Application in the network drive in the VM 在VM的网络驱动器中创建,加载和调试Visual C#ASP.NET Web应用程序

Error messages I get: 我收到的错误消息:

  • During creation: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) error message 创建期间: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))错误消息

  • During loading: If a Visual C# ASP.NET Web Application project is successfully created in a local drive, moved to the network drive and then opened from the network drive in the VM, I get the error message: 加载期间:如果在本地驱动器中成功创建了Visual C#ASP.NET Web应用程序项目,将其移至网络驱动器,然后从VM中的网络驱动器打开,则会收到错误消息:

     Creation of the virtual directory http://localhost:2648/ failed with the error: Filename: \\\\?\\Z:\\Test Projects\\WebApplication1\\.vs\\config\\applicationhost.config Error: Cannot read configuration file 

    But the configuration file applicationhost.config is still there. 但是配置文件applicationhost.config仍然存在。

How to solve the issue for the above given configuration? 如何解决以上给定配置的问题?

It looks like a permission issue to the file. 似乎是文件的权限问题。 Double check the identity you are using for your site (in IIS) Network Services, Local System or whatever 仔细检查您用于站点的身份(在IIS中)网络服务,本地系统或其他

  1. In IIS under Application Pools under 'Advanced settings' get the pool identity name. 在IIS中“高级设置”下“ Application Pools下,获取池标识名称。
  2. Give full access to that identity for your web.config file (even better for the whole folder application) 完全访问您的web.config文件的身份(对于整个文件夹应用程序甚至更好)
  3. Do the same for IIS_IUSRS group IIS_IUSRS组执行相同的操作

I have made a workaround for the issue. 我已经针对此问题制定了解决方法。 I have both a local folder and a shared folder for the same ASP.NET project. 对于同一个ASP.NET项目,我既有本地文件夹又有共享文件夹。 I always open the SLN file (project solution file for Visual Studio) from the local folder in the VM. 我总是从VM的本地文件夹中打开SLN文件(Visual Studio的项目解决方案文件)。 I periodically run a process in the VM to synchronize the changes in the both folders (local and shared) so that both folders can contain exactly same files. 我定期在VM中运行一个进程,以同步两个文件夹(本地和共享)中的更改,以便两个文件夹可以包含完全相同的文件。 I actually use FreeFileSync app for it. 我实际上使用FreeFileSync应用程序。 In this workaround, file merge conflict may occur if same files are edited both in the VM and the host before last synchronization. 在这种解决方法中,如果在上次同步之前在VM和主机中都编辑了相同的文件,则可能发生文件合并冲突。 In this case I can review the changes in the conflicted files to resolve conflict. 在这种情况下,我可以查看冲突文件中的更改以解决冲突。 My answer is really a workaround but it works. 我的回答确实是一种解决方法,但它可以工作。

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

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