'Can't open web project because IIS Express is not installed (even though it is)

I have recently changed machines at work, and a long-standing web project now refuses to open in Visual Studio.

The error log reads: "The Web project 'xxx' is configured to use IIS Express. You must download and install IIS Express in order to load this project."

However, IIS Express is installed on this machine (contrary to what the message is saying), and both the UseIISExpress and UseIIS options are set to false in the csproj file:

<UseIISExpress>False</UseIISExpress>
...
<UseIIS>False</UseIIS>

I have tried silly things, like switching between false and False, but so far to no avail. Is there anything else I can try?



Solution 1:[1]

In the absence of a request for a suitable web server in the csproj file, it defaults to its own best guess, which in this case happens to be IIS Express. So in this case, the answer was to change the UseIIS option to True, and the project opened correctly.

<UseIIS>True</UseIIS>

Solution 2:[2]

The way I found to make it work was by looking for the <ProjectExtensions/> tag and replacing it with:

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseCustomServer>True</UseCustomServer>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

Solution 3:[3]

I had the same issue but setting the UseIIS option to True did not work. I had to remove the .user file in order to successfully load the project.

Hope this helps somebody because it took a while to discover this.

Solution 4:[4]

For us the solution was, to comment the following line of code in the project file:

 <!--<IISUrl>http://localhost:56459/</IISUrl>-->

This worked (even if UseIIS was set to true).

Plattform: Windows 10, VS 2017

Solution 5:[5]

VS opened the project after deleting the IIS URL entry. look for e.g.

<IISUrl>http://localhost:49934/</IISUrl>"

Solution 6:[6]

As Rob Lyndon was saying, insert <UseIIS>True</UseIIS> in the .csproj file of your solution. For me, I had to insert it right here:

<Project DefaultTargets="Build" ...>
    ...
    <ProjectExtensions>
        <VisualStudio>
            <FlavorProperties GUID="{...}">
                <WebProjectProperties>
                    <UseIIS>True</UseIIS>

Solution 7:[7]

I tried setting <UseIIS> to both True and False. It didn't make a difference. Neither did changing <UseIISExpress> to true or false. I did try a variation of these settings but nothing seemed to work. I'm not saying this hasn't worked for others, but for me it hasn't.

I also deleted my .user file which again didn't fix the problem.

I even went as far as turning off IIS within Widows Features and turning it back on (Windows 7). None of it worked which was frustrating as logically it looked like it should.

The reason it didn't must have been something to do with Visual Studio 2013, at least it was in my case. I repaired VS2013 and it allowed me to load the project. I can't give any specifics as to why this was the case but after a repair and a reboot of the machine my project loads fine.

For reference as it might make a difference I have left the following in place:

<UseIISExpress>false</UseIISExpress>
....
<UseIIS>False</UseIIS>

Solution 8:[8]

Here is what I had to do collectively to fix this:

  1. Change UseIISExpress to false in first PropertyGroup tag at the top of the file.
<UseIISExpress>False</UseIISExpress>
~~~
2. Add/Change UseIIS to false directly after the UseIISExpress property.

False

3. Add UseCustomServer set to True within the ProjectExtensions tag
```
<UseCustomServer>True</UseCustomServer>
4. Comment out the SaveServerSettingsInUserFile using a html comment tag.
<!--- <SaveServerSettingdInUserFile>True</SaveServerSettingsInUserFile> --->

Solution 9:[9]

For anybody still having this problem, I have fixed it and it's quite simple, no need to edit project files. I tried changing the <UseIIS> tag to True didn't work.

So I tried installing IIS Express 10.0, which solved the problem. Turns out you really need to install IIS Express.

Solution 10:[10]

I got same issue in Visual Studio 2019 Community Edition and tried all the answers given before, but in vain. Eventually, I uninstalled [ASP.NET and web development workload] from the Installer and then installed again. And it worked.