编译MVC和pre-编译的意见和进入Azure的部署WebRole [英] Compile MVC and Pre-Compile Views And Deploy Into Azure WebRole

查看:163
本文介绍了编译MVC和pre-编译的意见和进入Azure的部署WebRole的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有以下要求:
1.编译一个大的MVC应用程序和pre-编译所有的意见。
2.运行转换的web.config文件
3.封装和发布部署到Azure的Web角色

So I have the following requirements: 1. Compile a large MVC app and pre-compile all of its views. 2. Run transforms for web.config 3. Package and publish for deployment into Azure Web Role

我可以做1修改文件PROJ,2期工程,如果我我们msdeploy,和3个工作正常,当我使用VS 2012 Azure工具。现在我想将这些一起放入脚本的过程。

I can do 1 with a modified proj file, 2 works if I us msdeploy, and 3 works fine when I use the VS 2012 Azure tools. Now I want to put these all together into a scripted process.

有没有人已经做了专家组的工作得到这个运行?

Has anyone already done the leg work to get this running?

推荐答案

1)

/p:PrecompileBeforePublish=true

2 + 3)

您需要添加下面的MSBuild目标在你.ccproj在转化Web.config文件复制(使用Web.Release.config作为你的目标转换):

You need to add the following MSBuild target in your .ccproj to copy in your transformed Web.config file (using Web.Release.config as your target for transforms):

<Target Name="CopySpecialFilesIntoPackage" AfterTargets="CopyWorkerRoleFiles">
  <ProjectName>WebProjectName</ProjectName>
  <TransformXml Source="$(ProjectDir)..\$(ProjectName)\Web.config" Transform="$(ProjectDir)..\$(ProjectName)\Web.Release.config" Destination="$(ProjectDir)obj\$(Configuration)\$(ProjectName)\$(ProjectOutput).config" />
</Target>

如果你想网络部署的Web角色的多个实例,您可以使用Azure网站或开源项目 Azure的Web场当你需要一个Web角色(如:自定义域的SSL)。

If you want to web deploy to multiple instances of a web role, you can use Azure Web Sites or the open source project Azure Web Farm for when you need a web role (eg SSL on custom domains).

这篇关于编译MVC和pre-编译的意见和进入Azure的部署WebRole的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆