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


当前回答

我们的网站也遇到了同样的问题。我们能够在Visual Studio中解决这些问题。我们使用的是2012终极版。

我们看到的潜在问题是,由于某种原因,在启用SSL后,VS为标准url和安全url分配了相同的端口。当我们从TFS中提取代码时,这个问题似乎出现了。

为了补救,我们采取了以下步骤:

Right click the project and go to Properties -> Web Under the project URL in the Use Local IIS Web Server section, remove the "s" from the URL and Save. (EG. go from https://:44301 to http://:44301. This will allow the next step to work) In Solution Explorer, select the Project and in the Properties window (press F4 if not displayed) change SSL Enabled to False then back to True. It will generate a new port that is different from the standard URL (In my case, I have 44301 as my SSL and 44305 as my standard) Navigate back to Properties -> Web and add the "s" back to the project URL. F5 and ride!

确保未选中覆盖应用程序根URL的复选框。

其他回答

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

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

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

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

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

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

在我的电脑上运行XAMPP的Apache服务器后,我也遇到了这个问题。为了运行它,我通过在管理员命令提示符上写入net stop http来终止8086端口上的所有进程。我认为杀死进程导致了这个问题。

对我来说,这个问题在完成以下步骤后就解决了;

关闭Visual Studio和SQL Management Studio。 转到服务并启动除SQL Server代理(SQLEXPRESS)之外的所有SQL服务。 转到C:\Users\<您的pc名>\Documents并删除IISExpress文件夹。 重新启动电脑。(我在上面没有发现的新事情) 启动Visual Studio并运行程序。

VS2015

编辑. csprojr .user文件

插入以下xml标记(如果已经存在,请不要重复)

<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>2870</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:2859</IISUrl>
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
<IISAppRootUrl>http://localhost:2859</IISAppRootUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>http://localhost/app</CustomServerUrl>

在XML节点中插入以上标签:

<ProjectExtensions><VisualStudio><FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"><WebProjectProperties>