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用户手册
随机推荐
- js中location.href的用法
Javascript中的location.href有很多种用法,主要如下: self.location.href="/url" 当前页面打开URL页面 ocation.href=& ...
- 关于google电子地图跟卫星地图位置不重合
再做项目时,用到了google地图的显示位置,就是在网页上插入事物在地图上的位置,点击卫星地图跟电子地图时发现不是重合,网上GOOGLE了下,说是加密的问题给偏移了500米左右,用google测量工具 ...
- folly
一.简介 Folly是,Facebook于2012年6月初开源的一个基于C++11的C++组件库,提供了类似Boost库和std库的功能,包括散列.字符串.向量.内存分配.位处理等,以满足大规模高性能 ...
- C++ enum
为啥需要枚举类型 编程语言中的所有特性都是为了满足某种需求,达到某个目的还出现.不会莫名其妙的出现在那. 枚举可以用来保存一组属性的值.enum的全称是enumeration意思是列举 看着这句话可能 ...
- makefile中的伪目标
伪目标就是总是被执行的目标,相对于目标来说,伪目标不会去考虑它的依赖的时间戳与自己时间戳的新旧关系,从而决定是否执行规则.伪目标格式: .PHONY:clean clean: -rm *.o 在mak ...
- Flume practices and sqoop hive 2 oracle
#receive the file flume-ng agent --conf conf --conf-file conf1.conf --name a1 flume-ng agent --conf ...
- Linux 系统常用命令汇总(一) 文件和目录操作
文件和目录 命令 选项 注解 示例 文件的基本操作 ls [选项][文件] 显示所有文件和目录 ls -al -a(A) 显示所有文件和目录,包括隐藏文件和目录(显示所有文件和目录,包括隐藏文件和 ...
- 循环队列+堆优化dijkstra最短路 BZOJ 4152: [AMPPZ2014]The Captain
循环队列基础知识 1.循环队列需要几个参数来确定 循环队列需要2个参数,front和rear 2.循环队列各个参数的含义 (1)队列初始化时,front和rear值都为零: (2)当队列不为空时,fr ...
- Android 手势识别类 ( 二 ) GestureDetector 源码浅析
前言:Android 关于手势的操作提供两种形式:一种是针对用户手指在屏幕上划出的动作而进行移动的检测,这些手势的检测通过android提供的监听器来实现:另一种是用 户手指在屏幕上滑动而形成一定的不 ...
- a标签中有点击事件
我们常用的在a标签中有点击事件:1. a href="javascript:js_method();" 这是我们平台上常用的方法,但是这种方法在传递this等参数的时候很容易出问题 ...