使用 csrun.exe 开始调试 Azure Web 角色 [英] Debugging an Azure web role started with csrun.exe
问题描述
我有一个 Visual Studio 解决方案,其中包含一个具有一个 Web 角色(包含 ASP.NET MVC Web API)的云项目.如果我按 F5,Azure 模拟器就会启动,我可以很好地调试 Web 角色.
I have a Visual Studio solution that has a cloud project with one web role (containing an ASP.NET MVC Web API). If I hit F5, the Azure emulator is started and I can debug the web role fine.
我还有一个包含集成测试的测试项目,用于端到端测试 web api.在 AssemblyInitialize 操作中,我使用 csrun.exe 来部署和启动 Azure 模拟器,如:
I also have a test project that contains integration tests, to test the web api end to end. In the AssemblyInitialize operation, I use csrun.exe to deploy and start the Azure emulator like:
"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\csrun.exe"
..\..\..\..\Sources\Cfg.Mgp.Infrastructure.Cloud\csx\Debug
..\..\..\..\Sources\Cfg.Mgp.Infrastructure.Cloud\bin\Debug\ServiceConfiguration.cscfg
/useiisexpress
因此,如果我开始测试,Azure 模拟器已准备就绪,并且测试可以正常执行.这一切都有效.
So if I start the tests, the Azure emulator is ready and tests are executed fine. This all works.
但是,如果我想从我的集成测试开始调试它,Web API 中的断点不会被命中(但它执行得很好).我尝试将调试器附加到 IISExpress、WaHostBootstrapper 和其他进程,但没有任何效果.
However, if I want to debug this starting from my integration tests, the breakpoints in the Web API are not hit (but it is executed fine). I tried attaching the debugger to IISExpress, WaHostBootstrapper and other processes, but nothing works.
如果使用 csrun.exe 启动 Azure 模拟器,有人知道如何调试 Web 角色吗?
Does anyone have any idea how to debug a web role if the Azure emulator is started with csrun.exe?
(备注:如果我按 F5,浏览器会启动;如果我然后运行集成测试,web 角色中的断点会正常.)
(Remark: if I hit F5, a browser is launched; and if I then run the integration tests the breakpoints in the web role are hit fine.)
推荐答案
我今天尝试了同样的事情 - 没有 /useiisexpress
标志.发生的事情是我在本地 IIS 上注意到一个网站是由计算模拟器制作的.我以管理员身份重新启动了 Rider,放置了一个测试断点,附加到 w3wp.exe 并且它起作用了.
I tried the same thing today - without the /useiisexpress
flag. What happened is I noticed on local IIS that a website was made from the compute emulator. I restarted Rider as Administrator, placed a testing breakpoint, attached to w3wp.exe and it worked.
这篇关于使用 csrun.exe 开始调试 Azure Web 角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!