本文翻译自:Unable to launch the IIS Express Web server
I have an asp.net MVC 4 solution. 我有一个asp.net MVC 4解决方案。 When I try to open it using Visual studio 2012, I get following error: 当我尝试使用Visual Studio 2012打开它时,出现以下错误:
Microsoft Visual Studio Microsoft Visual Studio
Configuring Web
https://localhost:
for ASP.NET 4.5 failed. 为ASP.NET 4.5配置Webhttps://localhost:
失败。 You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly. 您必须为ASP.NET 4.5手动配置此站点,以便该站点正确运行。 Could not find the serverhttps://localhost:44300/
on the local machine. 在本地计算机上找不到服务器https://localhost:44300/
。 Make sure the local IIS server has been configured to support secure communications. 确保已将本地IIS服务器配置为支持安全通信。OK Help 好的帮助
Although the solution opens. 虽然解决方案打开了。 Also, When I try to run it from debug menu, I get following error: 另外,当我尝试从调试菜单运行它时,出现以下错误:
Unable to launch the IIS Express Web server.
The start URL specified is not valid. https://localhost:44300/
and I can not debug the code. 而且我无法调试代码。 how to get rid of these errors and debug/run the web site from VS 2012 ? 如何摆脱这些错误并从VS 2012调试/运行网站?
Please suggest. 请提出建议。
#1楼
参考:https://stackoom.com/question/14bKA/无法启动IIS-Express-Web服务器
#2楼
It seems you need to do some configuring as you seem to be using SSL; 似乎您需要像使用SSL一样进行一些配置。 here's a step-by-step guide by Scott Hanselman himself: 这是Scott Hanselman本人的循序渐进指南:
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
#3楼
I had the exact same problem. 我有同样的问题。
The reason - bad IIS config file. 原因-IIS配置文件错误。
Try deleting the automatically-created IISExpress
folder, which is usually located at %userprofile%/Documents
, eg C:\\Users\\[you]\\Documents\\IISExpress
. 尝试删除自动创建的IISExpress
文件夹,该文件夹通常位于%userprofile%/Documents
,例如C:\\Users\\[you]\\Documents\\IISExpress
。
Don't worry, VS should create it again - correctly, this time - once you run your solution again. 不用担心,一旦再次运行解决方案,VS应该再次创建它-这次是正确的。
EDIT: Command line for deleting the folder: 编辑:删除文件夹的命令行:
rmdir /s /q "%userprofile%\Documents\IISExpress"
#4楼
@roblll had it right. @roblll说得对。 But for those of you who didn't want to dig for the answer, here it is: 但是对于那些不想挖掘答案的人来说,这里是:
- Close Visual Studio (might not be necessary, but it won't hurt). 关闭Visual Studio(可能没有必要,但这不会造成伤害)。
- Navigate to your Documents folder. 导航到“文档”文件夹。 This is where my IISExpress configuration directory was. 这是我的IISExpress配置目录所在的位置。
- In the config folder, there is a file called the application host. 在config文件夹中,有一个名为应用程序主机的文件。 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. 在以前的尝试中遭到轰炸时,Visual Studio应该已经在其中添加了它。
Note that there's a binding for HTTP with the port you intend to use for https. 请注意,HTTP与您打算用于https的端口存在绑定。
//Change this: <binding protocol="http" bindingInformation="*:44300:localhost" /> //to this: <binding protocol="https" bindingInformation="*:44300:localhost" />
Keep in mind, Visual Studio might have supplied different ports than you expected. 请记住,Visual Studio可能提供了与您预期不同的端口。 Just make sure that the ports in the binding correspond to what's in the Web tab of your project's properties. 只需确保绑定中的端口与项目属性的“ Web”选项卡中的端口相对应即可。
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
#5楼
I had a similar problem when running my solution from VS2012: 从VS2012运行解决方案时,我遇到了类似的问题:
Unable to launch the IIS Express Web server.
The start URL specified is not valid. https://localhost:44301/
I had the incorrect project selected as Startup Project. 我选择了不正确的项目作为“启动项目”。 I made the Cloud project the Startup (right click on project -> Set as Startup Project) and everything started working fine. 我将Cloud项目设置为Startup(右键单击项目->设置为Startup Project),一切开始正常运行。
#6楼
我遇到了同样的问题,就我而言,我只是清理然后重建解决方案,它对我有用