我有一个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?


当前回答

对我来说唯一有效的解决方案是创建另一个测试项目。然后按照下面的步骤:

Right click the project and go to Properties -> Web Under the project URL in the Use Local IIS Web Server section, copy the project URL(http:// localhost:59002/) - this is from the test project. Navigate to the project which is giving this error. Right click the project and go to Properties -> Web. Paste the project URL in the Use Local IIS Web Server section (URL copied from the test project). Close the test project and save. Delete the test project and run the project that gave the error. Works after that...

也许不是最好的方法,但这是我能让它工作的唯一方法。我收到这个错误消息后,我重新加载我的笔记本电脑(硬盘崩溃),并从他们所在的服务器上获得了我所有的项目。

其他回答

在我的情况下,我的applicationhost。配置文件以某种方式缺少以下两行代码

<add name="rules-64-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
<add name="xoml-64-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />

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

HKEY_CURRENT_USER\Software\Microsoft\IISExpress

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

试试下面的步骤:

正如@Yehuda shapiro所说的那样,删除IISExpress文件夹 重新启动计算机 删除项目中的。vs文件夹

确保以管理员身份运行VS !这将解决一切问题。比我晚。

我也有这个问题,在关闭防火墙后,在以管理员身份打开,在再次检查所有设置是否正确后。

我的问题是独特的,我想在本地测试SSL,但也有通过局域网可用的服务。所以我改变了应用程序的URL使用本地IP aka。我的情况是192.168.1.10。

切换回本地主机可以解决这个问题,关闭SSL也一样,所以我发现本地SSL证书只适用于本地主机。