Shared folder on VirtualBox not opening with Visual Studio 2015 (Website project)

不羁岁月 提交于 2019-11-27 07:13:51

问题


I created a windows 10 virtual box vm with Visual studio 2015 enterprise installed.

I tried to open an existing Visual Studio Website project solution in C:\sharedfolder\projectdirectory (With symbolic link) or \\VBOXSVR\myapp via virtualbox shared folder functionality, but it fails to open saying

"Creation of the virtual directory http://localhost:1849/ failed with the error: Filename: \?\UNC\VBOXSVR\myapp.vs\config\applicationhost.config Error: Cannot read configuration file"

If I copy the folder to C:\Code it opens without any issues?

Any idea how I can solve this problem? I need it in the shared folder because I am using MAC OS to do javascript dev stuff, so its good to share that folder.


回答1:


I tried this same solution and get the same result, I did some research and found this link that says that the shared folder shoud not be used as this

https://forums.virtualbox.org/viewtopic.php?f=2&t=62120




回答2:


This issue also occurs with VMWare Virtual Machine drive mappings.

I received this error when opening a working ASP project from a VMware virtual share:

Creation of the virtual directory failed with the error: Filename/... Error: Cannot read configuration file

Other suggestions which did not help:

  • Resetting the read-only permissions on the “C:\Users\\Documents\IISExpress\config\applicationhost.config” file or on the “:\”
  • Removal and re-installation of the entire Visual Studio suite, IISExpress, or “Microsoft ASP.NET Web Frameworks and Tools 2015”

All other, non-virtually mapped ASP projects, loaded correctly.

The core of the problem is that the virtual mapped drive causes incorrect references in the path of Visual Studio.

In my case the virtual drive was "Z" - “\?\Z:\Misc\"\applicationhost.config.

Solution: Move the project out of any virtual drive and into a local drive. If you are using Team Services, remap the project to that local directory.




回答3:


I ran into this same issue when trying to load an ASP.NET MVC project. (I'm using a Windows 10 guest and Debian 8 host.)

I found this answer by @MatthewFellows. Quoting:

There seems to be an issue with the way Virtualbox shares the folders between Host and Guest. As I discovered when doing this with a Vagrant setup, if you manually create a UNC share on the Host, connect to that share on the Guest and point IIS at it things go along smoothly.

This was in response to a question about IIS reading the Web.config file, but it turns out that this solution also worked for loading the applicationhost.config file. I created a Samba share manually, pointed Visual Studio to the project in that share, and that fixed the issue.



来源:https://stackoverflow.com/questions/35169668/shared-folder-on-virtualbox-not-opening-with-visual-studio-2015-website-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!