arnobpl arnobpl -4 years ago 143
ASP.NET (C#) Question

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.

My configuration is:

  • Visual Studio 2015 installed in Windows 10 virtual machine

  • A shared folder which is treated as a network drive and mapped as Z:\ in the VM

What I can do successfully:

  • Creation, loading and debugging Visual C# Windows Forms Application in the network drive in the VM

  • The same above for Visual C# ASP.NET Web Application but only in a local drive

What I cannot do successfully:

  • Creation, loading and debugging Visual C# ASP.NET Web Application in the network drive in the VM

Error messages I get:

  • During creation:
    Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
    error message

  • 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:

    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
    is still there.

How to solve the issue for the above given configuration?

Answer Source

I have made a workaround for the issue. I have both a local folder and a shared folder for the same ASP.NET project. I always open the SLN file (project solution file for Visual Studio) from the local folder in the VM. 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. I actually use FreeFileSync app for it. In this workaround, file merge conflict may occur if same files are edited both in the VM and the host before last synchronization. In this case I can review the changes in the conflicted files to resolve conflict. My answer is really a workaround but it works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download