Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a virtual directory failed with the error

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.

like image 395
Dmytro Avatar asked Aug 29 '12 02:08

Dmytro


People also ask

What does create virtual directory do?

A virtual directory is a directory name that you specify in IIS and map to physical directory on a local server's hard drive or a directory on another server (remote server). You can use Internet Information Services Manager to create a virtual directory for an ASP.NET Web application that is hosted in IIS.


2 Answers

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.

like image 122
pim Avatar answered Sep 16 '22 19:09

pim


I've already found the solution. I just had to edit C:\Users\Administrator\Documents\IISExpress\config\applicationhost.config file, by adding my site to <sites> node.

like image 42
Dmytro Avatar answered Sep 16 '22 19:09

Dmytro