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


当前回答

我也有同样的问题。请遵循以下步骤:

1-在Documents\IISExpress\config中打开applicationhost文件,如果不存在,则添加以下代码

            <site name="solutionname" id="2">
                <application path="/" applicationPool="solutionname">
                    <virtualDirectory path="/" physicalPath="physicaladdressofproject" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:xxxx:localhost" />
                </bindings>
            </site>

2-然后转到项目的根文件,删除使用不同版本的Visual Stdio对项目进行的所有更新

3-下一步进入[root]。vsconfig,删除applicationhost 它将自动创建

4 .运行项目

这对我很管用。

其他回答

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

@roblll说对了。但对于那些不想挖掘答案的人来说,这就是:

Close Visual Studio (might not be necessary, but it won't hurt). Navigate to your Documents folder. This is where my IISExpress configuration directory was. In the config folder, there is a file called the application host. Open that. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts. Note that there's a binding for HTTP with the port you intend to use for https. //Change this: <binding protocol="http" bindingInformation="*:44300:localhost" /> //to this: <binding protocol="https" bindingInformation="*:44300:localhost" />

请记住,Visual Studio可能提供了与您期望的不同的端口。只需确保绑定中的端口对应于项目属性的Web选项卡中的端口。

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

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

在安装Visual Studio 2013 Update 3后,我也遇到了同样的问题。 vs2013无法加载Microsoft.VisualStudio.TraceLogPackage.dll 无法启动IIS Express Web服务器 我的问题是通过以下步骤解决的: 1. 修复Visual Studio 2013更新 2. 以管理员身份启动开发人员命令提示符。 3.输入devenv.exe /setup,然后按enter

我也有同样的问题。我已经删除了C:/users/ path下的很多文件夹,以释放机器上的一些空间。在那之后,我开始得到这个错误。

我只是重新启动了我的机器,一切都很好。