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

WindowsAzureRemoteDebug.zip

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的更多相关文章

  1. Windows Azure Cloud Service (38) 微软IaaS与PaaS比较

    <Windows Azure Platform 系列文章目录> 最近一直想总结Azure IaaS和PaaS的区别与比较,写个博文详细说明一下.建议读者在阅读之前,先熟悉微软PaaS和Ia ...

  2. Windows Azure Cloud Service (11) PaaS之Web Role, Worker Role(上)

    <Windows Azure Platform 系列文章目录> 本文是对Windows Azure Platform (六) Windows Azure应用程序运行环境内容的补充. 我们知 ...

  3. Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL证书

    <Windows Azure Platform 系列文章目录> 在某些时候,我们需要在Azure PaaS Cloud Service配置HTTPS连接.本章将介绍如何在本地创建证书,然后 ...

  4. Windows Azure Cloud Service (39) 如何将现有Web应用迁移到Azure PaaS平台

    <Windows Azure Platform 系列文章目录> 本文将简单介绍,如何将企业内现有的ASP.NET应用程序迁移到Azure PaaS平台. 因为在迁移过程中,可能需要对现有的 ...

  5. 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 ...

  6. 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 ...

  7. Windows Azure Cloud Service (47) 修改Cloud Service时区

    <Windows Azure Platform 系列文章目录> 本文介绍内容适合于Azure Global和Azure China 我们在使用Cloud Service的时候,会发现默认的 ...

  8. [SDK2.2]Windows Azure Cloud Service (35) 使用VS2013发布Azure Cloud Service

    <Windows Azure Platform 系列文章目录> 好久没有更新BLOG了,今天我们继续Windows Azure相关的内容. 笔者最近把Visual Studio升级到了20 ...

  9. Windows Azure Cloud Service (1) 用户手册

    <Windows Azure Platform 系列文章目录> 下载地址 Cloud Service用户手册

随机推荐

  1. 一个完整的WSDL文档及各标签详解

    <?xml version="1.0" encoding="UTF8" ?> <wsdl:definitions targetNamespac ...

  2. ASP.NET调用Web Service

    1.1.Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求, ...

  3. Eclipse中使用Git-让版本管理更简单

    详细步骤: 第一部分  GIT介绍 (1)GIT往世今生 2005年开发Samba的Andrew试图破解BitKeeper(一款商业的版本控制系统)的协议(这么干的其实也不只他一个),被BitMove ...

  4. Windows系统镜像自动添加驱动程序

    2016年到了一家公司做网管,经常会为了装系统而烦恼,后来学习了WDS自动部署,但是在学习过程中发现启动镜像boot.wim中没有网卡驱动 导致wds报错,后来经过网上查找相关资料学会了如何向系统里添 ...

  5. c#MD5珍藏

    c#MD5珍藏 using System; using System.Collections.Generic; using System.Text; namespace MD5 { public cl ...

  6. runv kill 流程分析

    1.runv/kill.go Action: func(context *cli.Context) 该函数做的工作很简单,就是通过grpc客户端,发送一个grpc请求而已,如下: c.Signal(n ...

  7. 【每天一题ACM】 斐波那契数列(Fibonacci sequence)的实现

    最近因为一些原因需要接触一些ACM的东西,想想写个blog当作笔记吧!同时也给有需要的人一些参考 话不多说,关于斐波那契数列(Fibonacci sequence)不了解的同学可以看看百度百科之类的, ...

  8. Google Map API 使用总结

    Google Map API (一):显示一个最基本的地图 1 实现一个地图:<head>中引用: <script type="text/javascript" ...

  9. UESTC 884 方老师的专题讲座 --数位DP

    定义:cnt[L][K]表示长度为L,最高位为K的满足条件C的个数. 首先预处理出cnt数组,枚举当前长度最高位和小一个长度的最高位,如果相差大于2则前一个加上后一个的方法数. 然后给定n,计算[1, ...

  10. Android中Spinner下拉列表(使用ArrayAdapter和自定义Adapter实现) .

    今天学习了Spinner组件,使用Spinner相当于从下拉列表中选择项目,下面演示一下Spinner的使用(分别使用ArrayAdapter和自定义Adapter实现) (一):使用ArrayAda ...