我们可以使用MSBuild构建一个网站

问题描述:

我是Continous Integration的新手。有人可以让我知道我们是否可以建立一个网站使用MSbuild?

I am very much new to the Continous Integration. Could anyone please let me know whether we could build a website using MSbuild?

任何资料均可。

网站项目使用AspNetCompiler MSBuild任务。

You can build a Web Site project using the AspNetCompiler MSBuild task.

http://msdn.microsoft.com/en-us/library/ms164291.aspx

您的MSBuild文件可能看起来像这:

Your MSBuild file might look something like this:

<Project
        xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
        DefaultTargets = "PrecompileWeb">
        <Target Name = "PrecompileWeb">
                <AspNetCompiler
                        VirtualPath = "DeployTemp" 
                        PhysicalPath = "C:\ccnet\myProject\WebSite"
                        TargetPath = "C:\ccnet\myProject\PreCompiled"
                        Force = "true"
                        Debug = "true"
                        Updateable = "true"/>
        </Target>
</Project>

然后在您的ccnet.config中,您可以在任务块中添加如下内容项目:

And then within your ccnet.config, you would add something like the following in the tasks block for your project:

<msbuild>
    <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
        <workingDirectory>C:\ccnet\myProject\</workingDirectory>
        <projectFile>C:\ccnet\myProject\myproject.msbuild</projectFile>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>