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


当前回答

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

其他回答

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

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

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

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

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

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

我的情况是这样的:

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

因此,我将其更改为:

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

然后就成功了。

在我的情况下,项目是在网络驱动器上,删除IIS Express文件夹没有帮助,如其他答案所述。我的解决办法是复制项目到本地驱动器,它工作!

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.