Search code examples
c#asp.netvisual-studio-2015tortoisehg

Adding an existing website to Visual Studio solution throws a System.InvalidOperationException


I am trying to add an existing ASP.NET website to a Visual Studio 2015 solution, when I add the files they will all show up under the solution, but then the application crashes and restarts. When VS restarts my solution is empty. The error message being displayed is:

An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll

Additional information: This operation is not supported for a relative URI.

The website I am trying to add is a network location I have mapped as a network drive.

This worked fine for me in VS 2010, however trying to add to VS 2015 always throws this error. I tried repairing the VS installation as well as ensuring I am up to date. No one else on my team seems to have this issue, anyone have any ideas?

Thanks!


Solution

  • Well, I believe I have a solution - when adding the website I was selecting the mapped network drive from the file system, instead of entering the full network path. This worked for VS 2010, but apparently not for 2015, this seems to require the full network path... anyway, problem solved.

    Incorrect: selecting a website mapped to a drive letterr, i.e. L:\

    Correct: selecting the full network path to the website, i.e. \\server\website