Unable to load Web Application project due to its

2019-03-12 04:02发布

问题:

I've a problem with loading Web Application project in VS2013. This project depends on IIS Express, but I wouldn't install IIS Express because I already installed IIS.

What I can edit in .csproj file to load this project? I've tried to set to false, but it's wouldn't help me to solve problem.

Thank you for advice.

Upd.1: Also, I cannot create new web projects - VS tell me same things.

回答1:

Happened to me too. My workaround:

  1. Right-click the (failed-to-load) project => edit web.csproj
  2. Find the line <UseIISExpress>true</UseIISExpress>, and change it to false.
  3. Save, close, reload project.

Result - different error:

The Web Application Project web is configured to use IIS. To access local IIS Web sites, you must run Visual Studio in the context of an administrator account. In addition, you must install the following IIS components:

ASP.NET

So:

  1. Edit again, change <UseIIS>True</UseIIS> to false
  2. Save, close, reload project.

Result - Great Success!



回答2:

Try to delete user config file "ProjectName.csproj.user" then reload project.

VS 2012 can't load project which uses IIS with custom binding host - thinks it's using IIS Express



回答3:

It happened to me today. Changing "UseIIS" to false allowed to load project, but not use IIS. After some tests I've found the cause of the problem:

On previous CheckIn to VSS somehow the UAC (user account control) was switched on. So actually there were two alternatives: (i) Always use "Run as administrator" ; (ii) switch UAC off. I prefer (ii).



回答4:

I had a custom host file setup up with foo.localhost -> localhost bound on both ports for HTTP/HTTPS

checking on something i removed the host header for the binding on port 80. once reloading solution is when everything started crashing.

found a really old post that reminded me that i removed that host name from the binding.

adding foo.localhost header back to the binding and all my projects started reloading.



回答5:

If nothing works, try removing following two lines from .csproj file. (always worked for me)

<ProjectGuid>{3AA499DF-4A65-43B7-8965-D08A4C811834}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>