【发布时间】:2012-12-13 15:41:52
【问题描述】:
我们的 ASP.NET C# web 应用程序用于以下环境
.NET 框架 4
银光 4
IIS 7
Windows 2008
Visual Studio 2010
.NET IDE
C#
HTTPS (SSL)
为了使开发与我们的生产环境和 QA 环境保持紧密一致。
我在本地开发桌面上安装了 IIS express。
Scott Hanselman 记录了一个很好的分步指南,说明我们应该如何在我的本地开发桌面上为 IIS express 设置一个假的无签名证书,以便开发人员可以在 HTTPS (SSL) 开发环境中部署开发代码.
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
我在本地开发桌面上为 IIS express 创建了一个假的无签名证书,以便我可以在 HTTPS ( SSL ) 开发环境中部署开发代码。
我尝试通过选择“属性”选项卡页面中的“使用本地 IIS Web 服务器”单选按钮来配置 Visual Studio 2010。 我指定了“https://localhost/”的项目网址 (注意:我在上面提到的项目 url 中使用了 httpS,就像在 SSL 中一样)
我点击了“创建虚拟目录”。
我导航到 C:\Users{YOU}\Documents\IISExpress\config\applicationhost.config 文件。
我在管理员模式记事本中打开了 C:\Users{YOU}\Documents\IISExpress\config\applicationhost.config,但它没有显示我网站的任何条目。
我在 applicationhost.config 文件中手动输入了站点配置:
<site name="PivotServer(12)" id="14">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Program Files\IIS Express\WebSite1\Pivot_JIT_Sample2\PivotJitServer\PivotServer" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:45621:localhost" />
<binding protocol="https" bindingInformation="*:443:localhost" />
</bindings>
</site>
I need to figure out a way to debug using IIS express working in combination with Visual Studio 2010.
我尝试通过按“F5”从 Visual Studio 2010 运行该应用程序,但我得到一个弹出窗口错误框,指出:
“无法直接启动输出类型为类库的项目。为了调试此项目,请在此解决方案中添加一个引用该库项目的可执行项目。将可执行项目设置为启动项目。”
有人可以提出建议吗?
【问题讨论】:
-
Poss duplicate: stackoverflow.com/questions/11152272/… 该帖子中的最后一个答案可能就是您要找的。span>
-
@MikeSmithDev 谢谢!!但是,现在当我按下“F5”时,Visual Studio 只会启动 Web 浏览器以使用 url localhost 打开,但 Web 浏览器会抛出一个错误,基本上表明页面未找到。这意味着 Visual Studio 2010 无法启动 IIS Express。请帮忙。
-
如果将 url 更改为 'https://localhost:443/' 会发生什么?
-
@MikeSmithDev 谢谢。 443 端口号很重要
-
将此信息添加为答案 ;) 很高兴它有所帮助。
标签: visual-studio-2010 ssl .net-4.0 https iis-express