I have an msbuild xml file that builds about 20 vc2010 solutions. It retrieves the code from source control, builds all the solutions, and obfuscates the results (for the .net projects). I'd like to use this from ccnet. Is there a way to just 'call' this xml file to build my projects? Are there disadvantages to doing it this way?
Thanks
Yes, CruiseControl.NET has a task for building MSBuild projects.
Related
I am porting a visual studio project to mono develop. I have a fairly complex
post-build script in a .proj file, which copies various groups of files into the distribution
folder. Can anyone suggest a suitable alternative to this for linux? I tried xbuild,
but it doesn't support itemgroup and propertygroup.
The only way I can think of is to extend xbuild to support them,
https://bugzilla.xamarin.com/show_bug.cgi?id=3055
It is a known bug for a long time (> 6 months). Someone may implement it and submit the patch to Mono team.
NAnt was a possible alternative, but I don't think it worth the while to rewrite your MSBuild scripts to NAnt scripts.
I am working on a web application in VS 2008. To compile the applicaiton I go to Build in Visual Studio and click on Build Solution and when i have to deploy the site I click on Publish and it publishes the site to a directory.
Now my question is when do we use this msbuild file? what exactly this file does for Us?
Thanks.
You use a Build file when you have to do a series of operations that you want to do before or after compiling. This is used in most of the big projects where there will be other things (examples for other things are given below) that needs to be done and through MS build they will automated.
Examples of things that can be done with build :
Running Unit tests
Functional testing
Static Code analysis and reports
Packaging as an installer
I am pretty new to msbuild and aspnet_compiler.
I am using aspnet_compiler to compile web application project. Now I just saw the MSBuild.exe and noticed that its builds my website into the /mywebsite/precompiledWeb folder. Now why do I need to use MSBuild.exe? Can't I directly use the aspnet_compiler to see if my website can be built properly?
(Not sure if I explained it very well).
msbuild.exe is usually used to build projects and its dependencies. When you have a web application project with a project file, vs can use this to build not only your web project but all the dependencies involved. This would only build your source code files, not the markup files (.aspx,.ascx,.etc).
aspnet_compiler is meant to build a web site project that doesn't have a project file. This said, you can also use it to make sure your markup files are also built for your web application project.
You are correct you can manually invoke the aspnet_compiler.exe tool. But better would be to use Web Deployment Projects to help you do this.
I am attempting to compile my Silverlight control project with Nant without luck. Since my project contains XAML files, I am not sure if Nant is capable of generating the .g.cs files from the XAML file to be compiled into the project. I have come across posts where people suggest using the MsBuild task. Is there a way to avoid using the MsBuild task and compile the project using just Nant? I am not against using the MsBuild task. But would prefer to not use it if possible.
Thank You,
Vish
From what I understand nant currently does not support this out of the box. Most people are having to shell to msbuild for those portions of the compile step.
However if you know the extra commands for the precompiler, as in what program is used to gen the g.cs files then you could in theory extend nant with a new task to perform that step and then you could get what you need.
May be more work but if you get it to work post it to the community I'm sure they could use it too, if somebody has not done anything for it yet.
I have taken over the development of a web application that is targeted at the .net 1.0 framework and is written in C# and Visual Basic.
I decided that the first thing we need to do is refine the build process, I wrote build files for the C# projects, but am having tons of problems creating a build file for Visual Basic.
Admittedly, I do not personally know VB, but it seems like I have to hardcode all the imports and references in my build file to get anything to work...certainly not the best way to be doing things...
For any example: if I do not include the namespace System in the build file I will get several errors of common Unkown Types e.g: Guid
does NAnt typically require this for VB code or is does the VB code need a possible NAnt-freindly refactoring?
Does anybody have VB NAnt tips?
I have had a similar experience with NAnt and the vbc compiler for VB.NET projects that are developed with Visual Studio. My solution has been to avoid importing namespaces at the project level in Visual Studio (which occurs by default), and use explicit Imports statements at the class/file level. C# projects work this way by default (no project level namespace imports), and I like the extra information provided by explicit namespace directives when looking at a file.
Interesting that VB.NET and C# VS projects are so different in that respect.
I'm not sure, if you talk about VB or VB.Net.
Either way, have a look at Nant Contrib. Maybe they have a solution.
Are you calling msbuild to build? Or are you calling the VS.NET IDE exe to build. We've had no problems with our c#/VB.NET mix using CC.NET and NAnt and do not have to specify referenced assemblies inside of the build files.
What we do is using the IDE exe to build solutions that contain the projects we want to build.
I would recommend that you take the language specific compilers out of the equation for this one. And you can still use NAnt to do this:
First start off with a target that uses MSBuild because that will compile your project regardless of language used and take care of the dependencies for you. That means you don't need to hard code them in.
Example:
<target name="WinBuild">
<exec program="msbuild.exe"
basedir="${DotNetPath}"
workingdir="${SolutionPath}"
commandline="MySolution.sln
/nologo /verbosity:normal /noconsolelogger
/p:Configuration=Debug /target:Rebuild" />
</target>
I think once you've got that nailed - you can spend plenty of time trying to get NAnt to compile natively, but in my opinion, this is what I would use for this project since it seems to be a once off?
Hope that helps,
Cheers,
Rob G