让一个WebRole支持多个站点
2013-11-16 23:51
423 查看
在参考Configure a Web Role for Multiple Web Sites和Tips 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中可以支持多个站点
- iis中创建、配置一个web站点,使其可支持asp和php
- webuploader在同一个页面支持多个按钮实例
- webuploader在同一个页面支持多个按钮实例
- 在R5中如何将一个Domino Web服务器配置为多个Web站点--虚拟服务器
- 在一个IP地址上运行多个基于域名的web站点
- 如何设置IIS来支持多个WEB站点
- Apache配置在一个IP地址上运行多个基于域名的web站点
- 在一个Ubuntu系统上配置Apache支持多个站点
- 如何设置IIS来支持多个WEB站点
- 在一个IP地址上运行多个基于域名的web站点
- 在一个本地电脑上运行多个基于域名的web站点
- 在一个Ubuntu系统上配置Apache支持多个站点
- 介绍一个支持多个文本编辑器的HTML和CSS代码快捷编写插件
- 一个work around方法:解决Android 3.0~4.0下WebView 对锚点链接不支持的bug
- 一个IP建多个Web站点--主机头名法
- 使用 CodeIgniter 创建一个简单的 Web 站点
- 一个IP建多个Web站点--主机头名法
- 在微机室局域网中如何建立一个带域名解析的WEB站点
- 一个站点存在多个web.config时如何管理