Publish MVC v1 C# application through Cruise Control

不问归期 提交于 2020-01-02 18:18:08

问题


I am attempting to publish a 3.5 MVC website on my build server through cruise control.

Having looked around on the net it appears you need to wrap the ASP Net Compiler. I was hoping that this task can be called through MSBuild.

Any ideas on how this is done?


回答1:


This is fairly simple to accomplish with an MSBUILD file.

Here's a sample target the will rebuild your entire solution and will deploy your MVC web application to your desired output directory

<Target Name="Deploy">
    <MSBuild Projects="Solution.sln" Targets="Rebuild" />

    <MSBuild Projects="MVCWebProject\MVCWeb.csproj"
        Targets="ResolveReferences;_CopyWebApplication"
        Properties="OutDir=$(OutputFolder)\bin\;WebProjectOutputDir=$(OutputFolder)" />
</Target>

In your cc.net configuration, simply pass /p option to the MSBUILD task to specify the output directory for your web application as follows:

/p:OutputFolder=c:\Your\Output\Path




回答2:


This article specifies how to specify a precompiled website. http://msdn.microsoft.com/en-us/library/ms164291.aspx

Remember to also set the tag to 'true' in your MVC csproj file.



来源:https://stackoverflow.com/questions/2433837/publish-mvc-v1-c-sharp-application-through-cruise-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!