问题
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.
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
So if I start the tests, the Azure emulator is ready and tests are executed fine. This all works.
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.
Does anyone have any idea how to debug a web role if the Azure emulator is started with csrun.exe?
(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.)
来源:https://stackoverflow.com/questions/18272952/debugging-an-azure-web-role-started-with-csrun-exe