我有一个ASP。NET MVC 4解决方案。当我尝试使用Visual Studio 2012打开它时,我得到以下错误:

Microsoft Visual Studio 为ASP配置Web https://localhost:。NET 4.5失败。你必须 手动配置此站点的ASP。NET 4.5才能使站点 正确地运行。无法在https://localhost:44300/上找到服务器 本地机器。确保已配置本地IIS服务器 支持安全通信。

尽管解打开了。此外,当我试图从调试菜单运行它时,我得到以下错误:

无法启动IIS Express Web服务器。 指定的起始URL无效。https://localhost:44300/

我无法调试代码。如何摆脱这些错误和调试/运行网站从VS 2012?


当前回答

我今天碰到了这个错误。运行win8.1和vs2013。突然我的项目不能再运行了,我收到了“无法启动IIS快速Web服务器”的消息,没有进一步的信息。

过了一段时间,我发现IIS Express无法启动的所有项目都在运行。net 3.5。运行新版本的项目确实开始得很好。

我的解决方案是删除。net 3.5(从控制面板->打开/关闭窗口功能),重新启动窗口,然后再次添加。net 3.5。

其他回答

我在VS2012中运行我的解决方案时遇到了类似的问题:

无法启动IIS Express Web服务器。 指定的起始URL无效。https://localhost:44301/

我将不正确的项目选择为启动项目。我使云项目启动(右键单击项目->设置为启动项目),一切开始工作正常。

我的问题需要三方面的解决方案:

删除Documents文件夹中的IISExpress文件夹。 通过右键单击并选择“设置为启动项目”,或者通过解决方案属性将web项目设置为启动项目。 设置启动URL,或设置为“当前页面”或“特定页面”。我的设置是“不要打开任何一页”。等待来自外部应用程序的请求”,我不得不将其更改为“特定页面”,我将其留空,这样它就会进入我的应用程序的主页,然后才能正常工作。

@roblll说对了。但对于那些不想挖掘答案的人来说,这就是:

Close Visual Studio (might not be necessary, but it won't hurt). Navigate to your Documents folder. This is where my IISExpress configuration directory was. In the config folder, there is a file called the application host. Open that. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts. Note that there's a binding for HTTP with the port you intend to use for https. //Change this: <binding protocol="http" bindingInformation="*:44300:localhost" /> //to this: <binding protocol="https" bindingInformation="*:44300:localhost" />

请记住,Visual Studio可能提供了与您期望的不同的端口。只需确保绑定中的端口对应于项目属性的Web选项卡中的端口。

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

VS2015

编辑. csprojr .user文件

插入以下xml标记(如果已经存在,请不要重复)

<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>2870</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:2859</IISUrl>
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
<IISAppRootUrl>http://localhost:2859</IISAppRootUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>http://localhost/app</CustomServerUrl>

在XML节点中插入以上标签:

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

当我查看IIS Express注册表项时,我的问题最终解决了:

HKEY_CURRENT_USER\Software\Microsoft\IISExpress

我有一个CustomUserHome的入口指向我的网站,这是造成严重破坏。