Rob Lyndon
Rob Lyndon

Reputation: 12651

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?

Upvotes: 10

Views: 16693

Answers (11)

Sajjad Abdullah
Sajjad Abdullah

Reputation: 47

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.

Upvotes: 0

Edgar Silva
Edgar Silva

Reputation: 3

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.

Upvotes: 0

justdan23
justdan23

Reputation: 597

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> --->

Upvotes: 0

user2376865
user2376865

Reputation: 11

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

Upvotes: 1

Pablo Montilla
Pablo Montilla

Reputation: 3050

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>

Upvotes: 14

Bugs
Bugs

Reputation: 4489

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>

Upvotes: 0

Ashwath
Ashwath

Reputation: 407

  1. try to create a new project with the above setting and you can easily compare the .csproj files.

  2. In visual Studio's solution explorer, right click on the project ->Property -> Web in Left hand side -> select the appropriate web server.

  3. Compare the new .csproj file with old .csproj file and find the difference.

You can use DiffMerge.exe which will be shipped with visual studio and can be found in "drive:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\vsDiffMerge.exe"

Upvotes: -4

Sven M&#246;hring
Sven M&#246;hring

Reputation: 860

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>

Upvotes: 0

MichaelP
MichaelP

Reputation: 21

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.

Upvotes: 2

Andreas
Andreas

Reputation: 1

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

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

Upvotes: 0

Rob Lyndon
Rob Lyndon

Reputation: 12651

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>

Upvotes: 8

Related Questions