Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we build a website using MSBuild

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

like image 812
user98826 Avatar asked Apr 30 '09 18:04

user98826


3 Answers

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

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

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>

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>
like image 120
Jason Jones Avatar answered Nov 14 '22 21:11

Jason Jones


If you have an SLN file for the Web Site, then you can use the following command:

msbuild YourSolutionFile.sln

like image 22
Toby Artisan Avatar answered Nov 14 '22 21:11

Toby Artisan


Yes, you can - even with a "website".

What you need to do is add the "Web Deployment Project" and set it up so it will grab all the files from the website, compile them, and using something like WiX, you can create an installer for the files to be able to easily deploy your web site and all its files needed to a customer's computer.

Marc

like image 3
marc_s Avatar answered Nov 14 '22 19:11

marc_s