在参考Configure a Web Role for Multiple Web SitesTips for Publishing Multiple Sites in a Web Role两篇文章后,用记事本打开Azure项目文件(*.ccproj),在尾部添加如下配置,即可实现多个站点共享一个WebRole,从而更有效的利用Azure资源。

<PropertyGroup>
<!-- Inject the publication of "secondary" sites into the Windows Azure build/project packaging process. -->
<CoreBuildDependsOn>
CleanSecondarySites;
PublishSecondarySites;
$(CoreBuildDependsOn)
</CoreBuildDependsOn>
<!-- This is the directory within the web application project directory to which the project will be "published" for later packaging by the Azure project. -->
<SecondarySitePublishDir>azure.publish\</SecondarySitePublishDir>
</PropertyGroup>
<!-- These SecondarySite items represent the collection of sites (other than the web application associated with the role) that need special packaging. -->
<ItemGroup>
<SecondarySite Include="..\Admin\Admin.csproj" />
<SecondarySite Include="..\WebSite\WebSite.csproj" />
</ItemGroup>
<Target Name="CleanSecondarySites">
<RemoveDir Directories="%(SecondarySite.RootDir)%(Directory)$(SecondarySitePublishDir)" />
</Target>
<Target Name="PublishSecondarySites" Condition="'$(PackageForComputeEmulator)' == 'true' Or '$(IsExecutingPublishTarget)' == 'true' ">
<!--
Execute the Build (and more importantly the _WPPCopyWebApplication) target to "publish" each secondary web application project. Note the setting of the WebProjectOutputDir property; this is where the project will be published to be later picked up by CSPack.
-->
<MSBuild Projects="%(SecondarySite.Identity)" Targets="Build;_WPPCopyWebApplication" Properties="Configuration=$(Configuration);Platform=$(Platform);WebProjectOutputDir=$(SecondarySitePublishDir)" />
</Target>

让一个WebRole支持多个站点的更多相关文章

  1. WebLech是一个功能强大的Web站点下载与镜像工具

    WebLech是一个功能强大的Web站点下载与镜像工具.它支持按功能需求来下载web站点并能够尽可能模仿标准Web浏览器的行为.WebLech有一个功能控制台并采用多线程操作. http://sour ...

  2. 记一个同时支持模糊匹配和静态推导的Atom语法补全插件的开发过程: 序

    简介 过去的一周,都睡的很晚,终于做出了Atom上的APICloud语法提示与补全插件:apicloud_autocomplete.个中滋味,感觉还是有必要记录下来的.代码基于 GPL-3.0 开源, ...

  3. Windows Azure入门教学系列 (一): 创建第一个WebRole程序

    原文 Windows Azure入门教学系列 (一): 创建第一个WebRole程序 在第一篇教学中,我们将学习如何在Visual Studio 2008 SP1中创建一个WebRole程序(C#语言 ...

  4. Windows Azure中文博客 Windows Azure入门教学系列 (一): 创建第一个WebRole程序

    http://blogs.msdn.com/b/azchina/ 本文转自:http://blogs.msdn.com/b/azchina/archive/2010/02/09/windows-azu ...

  5. docker nginx实现一个主机部署多个站点

    原文:docker nginx实现一个主机部署多个站点 在某站租赁的虚拟机快到期了,续费得花200多,想到在阿里云新买的服务器,不如把这个也转移过去.域名我就用真实的吧,大家别黑我网站就好了,谢谢各位 ...

  6. Ubuntu14.04配置Apache支持多个站点

    怎样在一个Ubuntu的机器上(虚拟机)配置Apache支持多个网站呢? 比如你有一台独立的Ubuntu虚拟机,配有一个外网的IP(45.46.47.48),并且注册了两个域名AAA.com和BBB. ...

  7. MyBatis项目快速搭建及MySQL一个Statement支持多条命令参数

    一.简述 本文以笔记的形式,记录一个基本Mybatis项目的使用,方便后期项目使用到相关配置时直接复制使用. 二.项目结构 pom.xml中的依赖 <!-- https://mvnreposit ...

  8. 在一个Ubuntu系统上配置Apache支持多个站点

    查看原文请访问:http://codewenda.com/ubuntu16-04%E9%85%8D%E7%BD%AEapache%E6%94%AF%E6%8C%81%E5%A4%9A%E4%B8%AA ...

  9. 一个IP多个https站点配置

    在一台主机上放置一个https网站,究竟该怎么配置?对于IIS和Apache以及Nginx等不同的服务器,方法是不同的,网上有很多教程,在此就不再赘述了. 至于一台主机,如何配置多个https网站呢? ...

随机推荐

  1. POJ3282+模拟

    模拟题 /* 模拟 注意:相同一边的车有先后顺序! */ #include<stdio.h> #include<string.h> #include<stdlib.h&g ...

  2. codeforces #310 div1 D

    一开始写了个暴力模拟绳子的摆动轨迹 然后在Test 16 T掉了 后来%了一下别人的代码,发现需要对特殊情况进行特殊处理 首先我们考虑绳子的向右摆动,设当前位置为p,绳子当前长度为L 如果其旋转中心位 ...

  3. 李洪强iOS开发之宏定义方法来初始化一个单例对象

    单例的使用: .m 为了方便实用,只要将以下代码定义在header文件或者.pch文件即可: // .h #define singleton_interface(class) + (instancet ...

  4. 编程实现Windows关机、重启、注销

    要想编程使Windows关机.重启或者注销,可以使用ExWindowsEx这个API函数,该函数只有两个参数,第一个表示关机动作的标志,也就是你要让该函数关机呢,还是重启,还是注销等.可以使用EWX_ ...

  5. Hadoop初步认识

    Hadoop的介绍: Hadoop是一个适用于大数据的并行存储和计算的平台,是 Apache的一个用java 语言实现开源软件框架,实现了在大量计算机组成的集群中对海量数据进行分布式计算.Hadoop ...

  6. latex 写作

    一.下载:http://www.ctex.org/CTeXDownload 二.bst文件的作用 在tex文件调用bib时,如 \bibliographystyle{Science} \bibliog ...

  7. strlen的C/C+++实现

    2013-07-05 11:36:05 小结: 本函数给出了几种strlen的实现,有ugly implementation,也有good implementation.并参考标准库中的impleme ...

  8. ubuntu装机

    备份: .bashrc profile .vimrc exports defults/ 各种workspace中的源码 goagent/ 重转后安装: apt-get install openjdk- ...

  9. Android Framework------之Input子系统

    下面这是基于Android4.2代码的关于Input子系统的笔记.在这篇笔记中,只涉及Android相关的东西,关于Linux内核中对各种输入设备的统一,在本文中不作说明.此外,由于才疏学浅,文中难免 ...

  10. android SharedPreferences apply和commit的区别

    1.apply没有返回值而commit返回boolean表明修改是否提交成功2.apply是将修改数据原子提交到内存, 而后异步真正提交到硬件磁盘, 而commit是同步的提交到硬件磁盘3.apply ...