Publish MVC v1 C# application through Cruise Contr

2019-05-26 05:53发布

问题:

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.