且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何配置 Visual Studio 2008 以使用 IIS Express?

更新时间:2022-12-01 09:03:18

以下似乎适用于从命令行启动的 IIS Express:

  1. 打开网站的Properties

  2. 选择启动选项

  3. 在开始操作下选择Start External Program,把路径放到iisexpress.exe (C:Program Files (x86)IIS Expressiisexpress.exe)

  4. 命令行参数:/path:{项目解决方案的路径}/clr:3.5

  5. Server下,选择Use Custom Server

  6. 基本 URL:http://localhost:8080/(IIS Express 的默认值)

  7. 重要提示! 取消选中 Debuggers 下的所有内容,否则您将收到错误无法在 Web 服务器上开始调试.

有关使用配置文件启动的信息可以在以下站点找到:使用 IIS Express 调试您的 .NET Web 项目 [Tips &技巧].这是 VS2010 特定的,但我怀疑这同样适用于 2008.

The IIS Express FAQ notes that:

You can also manually launch IIS Express from the command line and use it with Visual Studio 2008, using the custom web server option

How do I configure the Start Options to get this working?

The following seems to work for IIS Express launching from the command line:

  1. Open the Properties for the web site

  2. Select Start Options

  3. Under Start Action select Start External Program, put the path to iisexpress.exe (C:Program Files (x86)IIS Expressiisexpress.exe)

  4. Command Line Arguments: /path:{path to the project solution} /clr:3.5

  5. Under Server, select Use Custom Server

  6. Base Url: http://localhost:8080/ (the default for IIS Express)

  7. Important! Uncheck everything under Debuggers otherwise you'll get an error "Unable to start debugging on the web server.

Information on launching using a config file can be found at this site: Debug Your .NET Web Project With IIS Express [Tips & Tricks]. This is VS2010 specific but I suspect the same will work for 2008.