在参考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. Binding to the Most Recent Visual Studio Libraries--说的很详细,很清楚

    Every version of Visual Studio comes with certain versions of the Microsoft libraries, such as the C ...

  2. POJ1228+凸包

    见代码. /* 凸包(稳定凸包) 题意:给出一些点,这些点要么是凸包的顶点要么是边上的. 证明每条边上都至少有3个点. */ #include<stdio.h> #include<s ...

  3. redis 性能监控和排查

    最近项目中接连遇到redis出现瓶颈的问题,现在把排查的一些经验记录下来备查,本篇只是思路的整理,不涉及具体的使用. 大体的思路如下: 1.通过slow log查看 参考 http://www.cnb ...

  4. 2.Adding a Controller

    MVC stands for model-view-controller.  MVC is a pattern for developing applications that are well ar ...

  5. Eclipse SVN插件冲突导致不能使用解决办法

    最近,由于安装插件导致eclipse的SVN插件不能使用,出现的问题实在很烦恼,通过试验发现当新安装的插件安装完毕后,只需要把eclipse-jee-kepler-SR2-win32-x86_64/e ...

  6. cocos2d-x 多分辨率适配详解(转载),以前北京团队设计的游戏,也是用这套方案

    http://blog.csdn.net/kyo7552/article/details/17163487 多种分辨率的适配一直都是一个蛋疼的问题,各家公司可能都有自己的一套方案.今天我为大家介绍的是 ...

  7. php中对共享内存,消息队列的操作

    http://www.cnblogs.com/fengwei/archive/2012/09/12/2682646.html php作为脚本程序,通常生命周期都很短,如在web应用中,一次请求就是ph ...

  8. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!

    启动 Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误的解决方法 http://blog.csdn.net/z ...

  9. Android EditView 阻止软键盘自动弹出

    最近再做一个查询内的小应用,界面最上面是一个EditText查询框,进行Activity后,总会弹起软键盘.这样就挡住了查询框下面的其他查询条件 控件,感觉很不友好.所以现在要做的就是在进入Activ ...

  10. Application.CommonAppDataPath的路径

    Application.CommonAppDataPath; win7的路径 C:\ProgramData\CompanyName\ProductName\2.0.5.1 [assembly: Ass ...