This is part 2 of screencasts I recorded that show how to speed up Windows Azure Development (see part 1 here). Specifically, in this screencast I show how we can create a macro in Visual Studio 2008 to attach or debugger to an IIS process.
We can then also create a keyboard shortcut for fast debugging of an Azure web role running in IIS. For more articles, screencasts and tips check out ehuna.org - follow me on twitter.com/ehuna
Here’s what is covered in the video:
1. The rinetd trick and the RinetdService – accessing your windows azure web roles from the real IP (not 127.0.0.1). See “An easier way to access the Windows Azure local development fabric from another computer” -
2. Adding a breakpoint in Visual Studio 2008.
3. W3WP.EXE – the IIS host process.
4. Tools > Attach to process – takes forever for the list of processes to come up.
5. Attach to W3WP.exe the IIS host process.
6. Load the ASPX page in the browser and debug your code-behind.
7. Create a Visual Studio macro (Macros > Record Temporary Macro).
8. Rename and save the temporary macro. Right-click and run.
9. Visual Studio > Options > Keyboard > Create keyboard shortcut.
10. Change something in your code, right-click web role and build, press “CTRL+SHIFT+ALT+?” and open a browser to access your ASPX page. Boom! Debug your code in 1-2 seconds!
11. Attach to process when running a windows service or a worker role.
12. If using the ASP.NET custom session provider that uses Azure storage, don’t use it in development. Set your web role instance count to 1 and store your ASP.NET sessions in proc.
Below you can find sample code and additional tips related to this screencast.
Download the Visual Studio Solution here:
http://blog.ehuna.org/files/Visual-Studio-Solution-AzureSpeed1.zip (26 KB)
Record a Macro in Visual Studio 2008
Macros > Record Temporary Macro
Tools > Attach to process
Stop recording of macro
Stop project from running in Visual Studio
Save temporary macro
Rename it “IISAttachToProcess”
Right click and “Run” the macro anytime – you’re now attached to the W3WP.exe IIS host process.
Keyboard shortcuts in Visual Studio 2008
Options > Keyboard
Search for “IIS…” – find and select the “IISAttachToProcess” macro
Set a keyboard shortcut of “CTRL+SHIFT+ALT+?”
Press “CTRL+SHIFT+ALT+?” and you’re now attached to the W3WP.exe IIS host process.
Change something in your code, right-click web role and build, press “CTRL+SHIFT+ALT+?” and open a browser to access your ASPX page.
Boom! Debug your code in 1-2 seconds!