Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express unable to create the virtual directory

Tags:

iis-express

I'm using IIS Express to create a virtual directory at http://localhost:5000/ and received this error:

Unable to create the virtual directory. The URL http://localhost:5000/ is already mapped to a different folder...

This is because I've used the port 5000 for an old project before and it's no longer needed.

My question is, how can I remove the old mapping using IIS Express so I can create the virtual directory at the same port again?

Thanks

like image 511
Leon Avatar asked Apr 10 '11 00:04

Leon


People also ask

How do I manually create a virtual directory in IIS Express?

In Visual Studio, on the File menu, click New and then click Web Site. In the New Web Site dialog box, click Browse. In the Choose Location dialog box, click the Local IIS icon. You must be a member of the Administrators group on the local computer to access the IIS metabase and create a virtual directory.

How do I create a virtual directory for ASP NET application in IIS?

To create a virtual directory with IIS Manager for an ASP.NET application. In IIS Manager, expand the local computer and the Sites folder. Right-click the site or folder where you want to create the virtual directory and then click Add Virtual Directory.


1 Answers

You should be able to accomplish this in one of two ways.

  • You can remove the old project, or change its port using WebMatrix, which has an administration interface for IIS Express.
  • You can also do it by hand, by modifying the applicationhost.config file directly. The file is located in the %userprofile%\documents\IISexpress\config folder. You can find the project configuration under the <system.applicationHost>/<sites> element.

UPDATE: WebMatrix has been discontinued and support has officially ended.

like image 145
Garett Avatar answered Sep 21 '22 21:09

Garett