Creating a virtual directory failed with the error

Dmytro picture Dmytro · Aug 29, 2012 · Viewed 68.5k times · Source

I can't solve this problem

enter image description here

I suggest I have to change c:\Windows\System32\drivers\etc\hosts file and add after

# localhost name resolution is handled within DNS itself.

the next line:

127.0.0.1       mysite.dev

but it doesn't help. Any suggestions?

Error ocсurrs when I try to open web site project in Microsoft Visual Studio 2012.

Answer

pim picture pim · Jun 17, 2016

More often than not, at least in my case, this happens is when a *.csproj.user file is in the project directory and has <UseIISExpress>true</UseIISExpress> in it.

Alternatively, as mentioned by Zachary Cutler you can also simply: close Visual Studio, delete the *.csproj.user file and reopen Visual Studio. This will force VS to rebuild the file.