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用户手册
随机推荐
- Windows 系统下json 格式的日志文件发送到elasticsearch
Windows 系统下json 格式的日志文件发送到elasticsearch配置 Nxlog-->logstash-->ElasticSearch Logstash https://ww ...
- 解决android的ListView嵌套在ScrollView中不能被滚动的问题
使用滚动条容易带来一个后果,就是高度和宽度不受控制了, 之前就遇到一个已经有ScrollView的页面需要加个列表listView,然后就发现listView只看到前两行数据,下面的看不到,拉滚动条也 ...
- 分享一个解决MySQL写入中文乱码的方法
分享一个解决MySQL写入中文乱码的方法 之前有发帖请教过如何解决MySQL写入中文乱码的问题.但没人会,或者是会的人不想回答.搜索网上的答案并尝试很多次无效,所以当时就因为这个乱码问题搁浅了一个软件 ...
- Android Sdk 和ADT Eclipse安装配置步骤
由于我们之前下载的jdk版本是1.6的,所以后面的andriod sdk等版本需要相对应.安装文件我都放在云盘里面,需要的可以下载 一:如果单独安装每一个软件,先期需要下载的软件包如下: 1.JDK ...
- 每日学习心得:UEditor样式被过滤无法显示问题
前言: 上周开发中有用到开源的富文本编辑器UEditor,在使用的过程中遇到了样式被过滤无法显示问题,经过一番折腾终解决,此外,还有一些关于获取前台界面元素的一些总结. 1. UEditor样式被过滤 ...
- 性能测试一般过程与LR性能测试过程
性能测试作为测试分类的一个大类,等同于系统测试中的功能测试.安全性测试和配置测试等,因此她的测试过程是对整个测试类型中测试过程的一个描述,因此包含了测试需要的确认目标,熟悉系统.获得需求等部分,因此性 ...
- JS判断数据是否是JSON类型
var isJson = function(obj){ var isjson = typeof(obj) == "object" && Object.pro ...
- mysql客户端授权后连接失败问题
在本地(192.168.1.152)部署好mysql环境,授权远程客户机192.168.1.%连接本机的mysql,在iptables防火墙也已开通3306端口.如下:mysql> select ...
- StaticFileMiddleware中间件如何处理针对文件请求
StaticFileMiddleware中间件如何处理针对文件请求 我们通过<以Web的形式发布静态文件>和<条件请求与区间请求>中的实例演示,以及上面针对条件请求和区间请求的 ...
- poj3984迷宫问题 广搜+最短路径+模拟队列
转自:http://blog.csdn.net/no_retreats/article/details/8146585 定义一个二维数组: int maze[5][5] = { 0, 1, 0, ...