views:

2099

answers:

5

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

Any information is appreciated.

A: 

unfortunately, if you have chosen "Website" as the project type you cant. However, if you chose "Web Application" project type, you can use MSBUILD to build it. Once you have created the "web application" project, you can right click on it and select "Add Web Deployment Project" which will add a wdproj file to your solution and you can customize the settings in there.

You can provide this wdproj file to your ccnet config file for the project which can run this as per the schedule configured. i can probably give you teh appropriate nodes required to configure in cc.net config file by tomorrow once i am in the office

Vikram
+2  A: 

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

marc_s
lexx
+13  A: 

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>
Jason Jones
This works rather well. I combine this with a couple of tasks that setup the web application in IIS to automate deployments.
Min
+1 - excellent sample
marc_s
A: 

Hi,

I want to use MSBuild to build website. and in my website .sln file is there.

and i able to getlatest using .sln file but i amnt able to build using MSBuild.

Please do help anyone for above use.

sachin
+1  A: 

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

msbuild YourSolutionFile.sln

red tiger
Or, you can just navigate to the directory where the .sln file is and type "msbuild" (assuming msbuild is in the current path).
Andy West