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. Jena学习笔记(2)——利用数据库保存本体

    注明:本文档是使用Jena2.6.4,数据库为MySQL,数据库驱动版本为mysql-connector-java-5.1.13-bin.jar. 1 Jena的数据库接口 Jena提供了将RDF数据 ...

  2. Loj 1003–Drunk(拓扑排序)

    1003 - Drunk PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB One of my fr ...

  3. C++中对象初始化

    在C++中对象要在使用前初始化,永远在使用对象之前先将它初始化. 1.对于无任何成员的内置类型,必须手工完成此事. 例如: int x=0; double d; std::cin>>d; ...

  4. selenium处理div生成弹框

    目前遇到的弹框有两种,一种是alert,一种是div,如果遇到div模拟的弹框,在用alert就不行了. 1. public static Alert getAlert(WebDriver dr) { ...

  5. SSH框架总结(框架分析+环境搭建+实例源码下载) 《转》

    这篇文章比较易懂,易理解: 首先,SSH不是一个框架,而是多个框架(struts+spring+hibernate)的集成,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活.易于扩展的多层W ...

  6. java 15- 5 List集合

    需求 1:List集合存储字符串并遍历.(步骤跟Collection集合一样,只是最初创建集合对象中的集合类改变了,Collection变成List) List集合的特点: 有序(存储和取出的元素一致 ...

  7. hydra爆破用法

    -R 根据上一次进度继续破解 -S 使用SSL协议连接 -s 指定端口 -l 指定用户名 -L 指定用户名字典(文件) -p 指定密码破解 -P 指定密码字典(文件) -e 空密码探测和指定用户密码探 ...

  8. localStorage实现购物车数量单价和总价实时同步(二)

    利用localStorage实时显示购物车小计和总价页面显示: 和昨天的原理相同,本地存储同时实时循环计算总价之和,注意循环时候的先清空再计算 Success is getting what you ...

  9. openstack常规操作命令梳理

    之前顺利部署了openstack+kvm的虚拟化云平台管理环境,其中,涉及到不少openstack操作命令,记录如下: 查看rabbitmq 队列[root@openstack ~]#rabbitmq ...

  10. Eclipse调试按钮消失问题

    Window-->Reset Perspective 把Eclipse重置一下,然后 点击红色框圈的向下的箭头,在弹出的菜单里边,点击 show debug toolbar 这个菜单项目,然后奇 ...