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用户手册
随机推荐
- rabbitmq server的安装以及常用的命令
Centos 源代码编译 安装 ErlangErlang依赖哪些库? A fully working GCC compiler environment Ncurses developm ...
- popupWindow弹出来后,背景变暗,半透明
/** * 点击评分,如果评分后,显示的弹出框 */ private void showMakeGradeMarkedWindow() { View view = LayoutInflater.fro ...
- [转载]在iTOP-4412开发板上调试helloworld应用
本文转自迅为论坛:http://www.topeetboard.com 1.安装ADB驱动 在开发板上调试 Android 应用,首先要安装 ADB 驱动. 通过“SDK Manager.exe”来安 ...
- 杂谈SharpDx中的WIC组件——我们需要WIC的图片编码功能么?
在前文 SharpDX之Direct2D教程II——加载位图文件和保存位图文件 中,发现在VB2010中不能很好的运用SharpDx中的WIC组件进行图片的编码工作.可能是我的设置问题,也可能是Sha ...
- js制作倒计时效果
该程序可以计算任意指定的两个日期中间的差值. 本例子的指定日期是2017年1月1日,当前时间是2016年10月21日:计算它们之间的差值,在网页上显示如图所示: 关键部分代码: var nowtime ...
- selenium使用等待的几种方式
1.使用java的sleep try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated c ...
- 实用图像处理入门 - 2 - Windows平台下编译openCV
标签中的部分 font-family: 华文细黑; font-size: 26px; font-weight: bold; color: #611427; margin-top:40px; } h2 ...
- MySQL数据库学习笔记(四)----MySQL聚合函数、控制流程函数(含navicat软件的介绍)
[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/4 ...
- sort()和qsort()方法详解
1,C++自带的自动排序方法:sort(); 要使用此函数只需用#include <algorithm> sort即可使用. sort(begin,end),表示一个范围,例如: int ...
- CSS选择器的权重与优先规则
权重顺序 “important > 内联 > ID > 类 > 标签 | 伪类 | 属性选择 > 伪对象 > 继承 > 通配符”. 原文:http://w ...