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


当前回答

一直在乱搞IISExpress和项目,试图让它在一个不同的URL上监听,而不是localhost,当返回时,我有这个错误,在遵循这里的所有答案后,没有一个工作。

最终注意到,在项目Porperties -> Web中,我在开始操作下检查了“开始URL”,但输入框是空的。将此更改为“当前页面”修复了我的问题。

其他回答

其他的解决方法对我都不起作用。我禁用了“编辑-继续”功能,一切正常:)

我也有类似的问题-由于这个错误,VS无法加载特定的web项目。 以下是有帮助的方法:

在解决方案中编辑项目 查找UseIISExpress和/或UseIIS 并确保它们不会相互交叉。

我的情况是这样的:

...
<UseIISExpress>True</UseIISExpress>
...
<UseIIS>True</UseIIS>
...

因此,我将其更改为:

...
<UseIISExpress>True</UseIISExpress>
...
<UseIIS>False</UseIIS>
...

然后就成功了。

我在我的机器上为虚拟机设置了Internet连接共享。我把它关掉了,我就可以在Visual Studio 2015中调试了。然而,为了在重启后持续调试,我需要将Internet连接共享服务设置为手动启动,即使我的Internet连接都没有启用Internet连接共享。

我将提出一个解决这个问题的方法:

1.使用以下控制台命令删除\Documents\IISExpress文件夹:rmdir /s /q "%userprofile%\Documents\IISExpress"

Delete the applicationhost.config file which is placed within the .vs\Config\ folder in your Visual Studio project root folder. Change the project’s website random URL: within Visual Studio, right-click to the project node in Solution Explorer, then select Properties; navigate through the Web panel, then change the number in the Project Url textbox value. Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1 as shown in the following screenshot (thanks to Juan M. Elosegui for reporting this on this SO thread and for the image):

好运!

我阅读了这里所有的答案,然后,正如Mihail Shishkov回答中提到的,跳转到项目属性> Web >服务器>创建虚拟目录。这句话的效果是让我得到了一个例外:

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