How to use VS2012 remote debug Windows Azure Cloud Services
Background:
Windows Azure Cloud Services 可以在本地调试,使用Visual Studio 2012 + 模拟器 Emulator。但是模拟器的工作状态和环境和真实的云环境还是有区别的。
所以有些问题,需要远程调试(Remote Debug)
Steps:
1、Local :Install IDE Visual Studio 2012 at local
2、Remote Machine:远程机器需要安装Remote Tools for Visual Studio 2012 Update 2
下载地址:rtools_setup_x64.exe 选择正确的操作系统版本(32位的工具只能Debug 32位的程序,64位的调试64位程)。
Note:一般远程调试,准备上述就可以了。Cloud Service的Instance安装Remote Tools可以放在Setup WebRole 或者WorkRole 的时候同时安装Debug工具。
3. Upload rtools_setup_x64.exe to storage blob container named "Tools".
4. Cloud Service
1)Create Cloud Service with a webrole instance(asp.net mvc4 with empty template).
2) Write code to install Remote Tools in Role OnStart method. Will be attached the detail code about how to implement method StartStopDebugService().
public override bool OnStart()
{
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
RoleEnvironment.Changing += RoleEnvironmentChanging;
RoleEnvironment.Changed += RoleEnvironmentChanged;
try
{
StartStopDebugService();
}
catch (Exception ex)
{
//Trace Startup Exception
Trace.TraceError(ex.Message);
throw;
}
return base.OnStart();
}
3)Configuration
Double click webrole under cloud service porject to edit properties.
Settings:

Endpoint:
The endpoint RemoteDebugger with public port 4016 is used for local Visual Studio connecting to the remote debugger process.

Local Storage:
When web role starting, it will download remote tool from storage blob contrainer to local storage, and then install it.

5. Publish cloud service
Configurate publish settings with default.

6. Debug
1) Open website of the cloud service
2) Set breakpoints in VS
3) Open Debug->Attach to process
if w3wp.exe process doesn't in the available prcesses list, please refesh website.

7. Source Code
I have removed reference packages from the solution, if you want build successfully, you should add them yourself.
7. Enjoy debuging.
If you have any question, feel free to ask me by repling comment.
How to use VS2012 remote debug Windows Azure Cloud Services的更多相关文章
- Windows Azure Cloud Service (38) 微软IaaS与PaaS比较
<Windows Azure Platform 系列文章目录> 最近一直想总结Azure IaaS和PaaS的区别与比较,写个博文详细说明一下.建议读者在阅读之前,先熟悉微软PaaS和Ia ...
- Windows Azure Cloud Service (11) PaaS之Web Role, Worker Role(上)
<Windows Azure Platform 系列文章目录> 本文是对Windows Azure Platform (六) Windows Azure应用程序运行环境内容的补充. 我们知 ...
- Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL证书
<Windows Azure Platform 系列文章目录> 在某些时候,我们需要在Azure PaaS Cloud Service配置HTTPS连接.本章将介绍如何在本地创建证书,然后 ...
- Windows Azure Cloud Service (39) 如何将现有Web应用迁移到Azure PaaS平台
<Windows Azure Platform 系列文章目录> 本文将简单介绍,如何将企业内现有的ASP.NET应用程序迁移到Azure PaaS平台. 因为在迁移过程中,可能需要对现有的 ...
- Windows Azure Cloud Service (42) 使用Azure In-Role Cache缓存(1)Co-located Role
<Windows Azure Platform 系列文章目录> Update 2016-01-12 https://azure.microsoft.com/zh-cn/documentat ...
- Windows Azure Cloud Service (43) 使用Azure In-Role Cache缓存(2)Dedicated Role
<Windows Azure Platform 系列文章目录> Update 2016-01-12 https://azure.microsoft.com/zh-cn/documentat ...
- Windows Azure Cloud Service (47) 修改Cloud Service时区
<Windows Azure Platform 系列文章目录> 本文介绍内容适合于Azure Global和Azure China 我们在使用Cloud Service的时候,会发现默认的 ...
- [SDK2.2]Windows Azure Cloud Service (35) 使用VS2013发布Azure Cloud Service
<Windows Azure Platform 系列文章目录> 好久没有更新BLOG了,今天我们继续Windows Azure相关的内容. 笔者最近把Visual Studio升级到了20 ...
- Windows Azure Cloud Service (1) 用户手册
<Windows Azure Platform 系列文章目录> 下载地址 Cloud Service用户手册
随机推荐
- Semiconnected--强连通缩点
1451: Semiconnected 时间限制: 1 Sec 内存限制: 32 MB 提交: 79 解决: 20 题目描述 For a directed graph G = (V, E), if ...
- Android 内存分析
1.使用adb命令查看app内存使用情况 adb shell dumpsys meminfo <package_name> adb shell top | grep <package ...
- linux chromuim安装常用插件(flash,手势,拖拽,广告屏蔽)
1.本机kali2.0 64位,kali基于Debian.文章所用的所有插件请到http://files.cnblogs.com/files/yuuyuu/chromium_plugins.tar. ...
- Git指令总结和图表
Git 是一个很强大的分布式版本控制系统.它不但适用于管理大型开源软件的源代码,管理私人的文档和源代码也有很多优势. Git常用操作命令: 1) 远程仓库相关命令 检出仓库:$ git clone g ...
- PHPCMS列表页伪静态
phpcms v9内容管理系统可以方便建立网站,并且生成静态化,但是列表页往往采取伪静态,因为列表页太多每发一篇文章就生成一遍静态效率太低,phpcms列表页及分页伪静态规则如何设置呢? phpcms ...
- oracle 11g dataguard创建的简单方法
oracle 10g可以通过基于备份的rman DUPLICATE实现dataguard,通过步骤需要对数据库进行备份,并在standby侧进行数据库的恢复.而到了11g,oracle推出了Dupli ...
- VMware + OpenStack: 从 Plugin 到 VIO (VMware Integrated OpenStack)的演进
VMware 做为实际上的企业虚拟化领导者,对 OpenStack 的态度一直在变化.一开始,VMware 表达出与 OpenStack 的竞争态度.随着 OpenStack 的逐步壮大并且一步一步进 ...
- 快速理解Kafka分布式消息队列框架
作者:刘旭晖 Raymond 转载请注明出处 Email:colorant at 163.com BLOG:http://blog.csdn.net/colorant/ ==是什么 == 简单的说,K ...
- HTable和HTablePool使用注意事项
HTable和HTablePool都是HBase客户端API的一部分,可以使用它们对HBase表进行CRUD操作.下面结合在项目中的应用情况,对二者使用过程中的注意事项做一下概括总结. HTable ...
- POJ 3255 Roadblocks --次短路径
由于次短路一定存在,则可知次短路一定是最短路中某一条边不走,然后回到最短路,而且只是一条边,两条边以上不走的话,就一定不会是次短路了(即以边换边才能使最小).所以可以枚举每一条边,算出从起点到这条边起 ...