且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法启动IIS Web服务器,如何调试

更新时间:2022-10-19 16:32:32

卸载VS& IIS,然后使用此处完全刻录VS 的建议VisualStudioUninstaller /发布rel =nofollow noreferrer>这个Microsoft工具。



重新安装VS并且它正在工作。



全部谢谢。


I am having problems with my IIS Express in Visual Studio Pro 2015. When I try and start a website I get an error with the single line

The project is one that I have written but have reloaded from TFS after my HDD was scrapped. The same error occurs if I create a new project.

I am using the applicationhost.config file stored in project\.vs\config

I have tried the following:

  • Deleted %project%\.vs\config and C:\Users\Paul\Documents\IISExpress\ and let VS rebuild it
  • Temporarily changed the bindings in applicationhost.config manually to include * and https
  • Changed the port number in Preferences -> Web -> Project Url
  • Looked for conflicting ports in TCPView (trying to run from VS doesn't appear here as it doesn't get that far)
  • Toggled .Net in Turn Windows features on or off
  • Uninstalled IIS and re-installed
  • Uninstalled VS and re-installed
  • Cleaned and rebuilt solution
  • Restarted many times

If I run C:\Program Files (x86)\IIS Express\iisexpress.exe /config:%project%\.vs\config\applicationhost.config /site:Name /siteid:2 /systray:true /trace:error there are no errors and IIS starts as expected.

**The only obvious difference between this installation and the last is that I now have IISExpress on C: drive and VS on D: **

I only have the following software installed on this PC: Visual Studio Pro 2015, Xamarin Studio 6, Android Studio, and SQL Server Express 2014. OS is Windows 10 Pro.

I understand that the error is very generic, can anyone advise how I debug what the actual fault is?

EDIT: I'm checking through the details at https://blog.lextudio.com/2015/11/jexus-manager-secrets-behind-visual-studio-iis-express-integration/

My csproj file appears to be missing many of the IIS related tags in that page, I added them for chance but it still fails:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <UseIISExpress>true</UseIISExpress>
  </PropertyGroup>
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <StartPageUrl>
          </StartPageUrl>
          <StartAction>CurrentPage</StartAction>
          <AspNetDebugging>True</AspNetDebugging>
          <SilverlightDebugging>False</SilverlightDebugging>
          <NativeDebugging>False</NativeDebugging>
          <SQLDebugging>False</SQLDebugging>
          <ExternalProgram>
          </ExternalProgram>
          <StartExternalURL>
          </StartExternalURL>
          <StartCmdLineArguments>
          </StartCmdLineArguments>
          <StartWorkingDirectory>
          </StartWorkingDirectory>
          <EnableENC>True</EnableENC>
          <AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

EDIT: This dev has the same problems

Uninstalled VS & IIS, then followed the advice here to completely burn VS by using this Microsoft tool.

Reinstalled VS and it's working.

Thanks all.