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


当前回答

我的解决方案是从IIS Express切换到本地IIS。 确保您的虚拟目录绑定到相同的端口。

其他回答

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

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

不需要删除C:\Users[you]\Documents\IISExpress目录下的整个IISExpress文件夹。

评论:

<binding protocol="https" bindingInformation="*:8090:localhost" />

在applicationhost中。IISExpress文件夹下的config文件。

Before you try anything else, make sure you 1. restart visual studio (mostly for refreshing memory resident options from files) and 2. restart your system (mostly for invalid file locking). If your problem is such temporary or self-fixed those will do without changing anything. It worked for me with PC restart. Also if you work on a multi-user project make sure you have the latest workable version - someone else may had check in something invalid by mistake at e.g. the project file and you mess with your system for no reason. If those won't work, then you probably need to alter some setting(s) that are stuck, missing or need modification - there are plenty propositions on other answers.

我也有同样的问题。 原因是IIS配置文件不好。

尝试删除自动创建的IISExpress文件夹,该文件夹通常位于%userprofile%/Documents,例如C:\Users\[you]\Documents\IISExpress。

别担心,一旦你再次运行你的解决方案,VS应该再次创建它——这次是正确的。


EDIT:删除文件夹的命令行:

rmdir /s /q "%userprofile%\Documents\IISExpress"

在禁用防火墙后,我能够毫无问题地运行它。