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


当前回答

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.

其他回答

分享给未来的读者。手动创建一个虚拟目录对我来说很有用。

在解决方案资源管理器中选择项目 按Alt + Enter 转到网页部分 单击“创建虚拟目录”

我最近遇到了这个问题,这是因为项目存储在网络驱动器上。由于IIS在本地作为NetworkService运行,它无法访问存储项目的网络共享。假设从网络共享打开项目违反最佳实践,我将项目复制到本地C:\ drive,然后项目按预期运行。

在解决方案资源管理器中右键单击项目

tab Web,按“创建虚拟目录”

在我的情况下,我去调试>项目属性> Web(在visual studio),然后我在服务器部分将IIS Express更改为本地IIS

我也遇到了同样的问题,但对我有效的解决方法是不同的。

在VS2013中打开调试> {YourWebsiteName}属性 选择“Web”选项卡。 在“服务器”下,我发现“覆盖应用程序根URL”被选中。我取消勾选并保存。

这就是我所需要的一切,让它运行起来。