1
votes

I have created a demo project in VS 2015 and I tried to create a virtual directory from VS: Right click on project-> properties-> web -> selected local IIS option and click on create virtual directory.

But I am getting this error:

unable to create the virtual directory. The web server http://localhost/MVCDemo" could not be found.

Here are screenshots of the error:

error

enter image description here

enter image description here

1
what is the url of your site in iis?Jalpa Panchal
I'm facing the same problem with VS 2019. Were you able to find a solution to this issue?bgh

1 Answers

0
votes

If Visual Studio can't create a virtual directory for your application, chances are there's a mismatch between your project's settings on Visual Studio and its corresponding settings on IIS Manager.

In my particular case I solved this problem by recreating the default web site on IIS Manager.

After recreating the default web site on IIS Manager, Visual Studio became once again able to create the virtual directories, and I could then debug the web application with Local IIS.