更新时间:2022-12-01 09:03:18
以下似乎适用于从命令行启动的 IIS Express:
打开网站的Properties
选择启动选项
在开始操作下选择Start External Program
,把路径放到iisexpress.exe
(C:Program Files (x86)IIS Expressiisexpress.exe
)
命令行参数:/path:{项目解决方案的路径}/clr:3.5
在Server
下,选择Use Custom Server
基本 URL:http://localhost:8080/
(IIS Express 的默认值)
重要提示! 取消选中 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:
Open the Properties
for the web site
Select Start Options
Under Start Action select Start External Program
, put the path to iisexpress.exe
(C:Program Files (x86)IIS Expressiisexpress.exe
)
Command Line Arguments: /path:{path to the project solution} /clr:3.5
Under Server
, select Use Custom Server
Base Url: http://localhost:8080/
(the default for IIS Express)
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.