msbuild

How can I auto increment the C# assembly version via our CI platform (Hudson)?

Myself and my group is horrendous at incrementing assembly version numbers and we frequently ship assemblies with 1.0.0.0 versions. Obviously, this causes a lot of headaches. We're getting a lot better with our practices via our CI platform and I'd really like to set it up to auto increment the values within the assemblyinfo.cs file so...

MSBUILD Batching Tasks Executes Each Statement in a batch

I have the following task in my MSBuild script: <Target Name="ZipStates"> <Message Text="CREATING ZIP FOR %(StateSet.Name)" /> <CreateItem Include="$(StagingArea)\v$(VersionString)\States\%(StateSet.Name)\v$(VersionString)%20%(StateSet.Abbreviation)XTend\**\*.*" > <Output ItemName="ZipFiles" TaskParameter="Include"/> ...

How do I make a WiX installer with a completely self-contained .NET 3.5 sp1 installer?

I need to include the full .NET 3.5 sp1 installer into my installer, which is in WiX. I need that boostrapper to be entirely self contained, with no web access at all. It is just not allowed for this installer to require the web; we have customers in outer Mongolia (I'm serious, not just using the place name because it's remote) to who...

What XSLT do you use to format MsBuild XML output in CruiseControl.Net?

Hi We currently don't format our msbuild output in CC.NET (CruiseControl.Net) and as a result, finding the cause of a broken build involves reading the XML to find the last 'success="false"' instance in the output. What XSLT do you use to format your msbuild output, and are you happy with the resulting HTML? I.e. do you find it easy to...

Msbuild doesn't copy references (dlls) if using project dependencies in solution

Hi, i had a look on many similar questions on this side but none of them answered the question to my problem. The whole day i tried to solve this by finding a solution (via google etc.): I have 4 projects in my VS solution (everyone targeting .net 3.5) - for my problem only these two are important: MyBaseProject <- this class library...

Delay signing during development and not on the build server

I've got a few projects that are configured for delay signing on development machines, and I want to configure the build server so that it doesn't delay sign release builds. How can I do this? I'm using VSTS/TFS. The question is different, but the answer is what I need. ...

MSBuild "Unable to copy file" in CI environment

I'm using Hudson as a continuous integration server. The jobs ultimately kick off MSBuild. Everyone once in a while, my build fails with a non-code-compilation error out of MSBuild: C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2703,9): error MSB3021: Unable to copy file "..\Lib\Microsoft\Microsoft.Practices.Unity.C...

Choosing which Service Pack of the .Net Framework to build against

I have read many questions (and answers) around here that had similar sounding terms in them as this question, but all of them ended up being about building against different major versions of .Net. I am in much deeper trouble, unfortunately. Here is the story. Our customers use version 2.0 of the .Net framework. Just 2.0, no service pa...

Visual Studio incremental build: XML documentation file is created too late

I have a DLL project for Visual Studio 2005 that has "XML documetation file" turned on. Whenever I do an incremental build, during post-build event execution there is no XML documentation file in the output directory. If I pause the build during post-build event (using sleep utility from GnuWin32 CoreUtils), I can see the file in the ou...

MSBuild specify platform for build

Hi, Is it possible to specify the target platform (x64, x86) when building a project? I have a build task that looks as follows: <MSBuild Projects="%(AgentProjectFiles.FullPath)" Properties="Architecture=x86;Configuration=$(Configuration);Optimize=$(Optimize);Platform=$(Platform);OutputPath=$(OutputDirectory)\Agent\;ReferencePath=$(Re...

TFS Build SourceTfs.Checkout

I am trying to get my build to checkout some files (using Microsoft.Sdc.Common.tasks) and then to check them in after the build has finished. But I can't seem to get this working at all, let alone before and after the build. Whaereabouts should this sort of code live? <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Desk...

Missing references with MSBuild, but auto-resolve in Visual Studio 2008

I have a 2008 Solution that is giving me all sorts of missing assembly reference errors when we try to build it with MSBuild. I brought up the solution in Visual Studio and at first I got the same compile errors. Lots of missing references, so I went to the projects in question and expanded the References group and saw the exclamation...

MSBuild Conditional Imports

Is there a workaround for conditional imports in MSBuild? I've found evidence here and here detailing a bug in the MSBuild IDE interface. In particular, Import statements do not reload when building: This is a known limitation. VS will only ever process the tags once, when the project is loaded. So whatever tag is active at the...

What is the quickest way to convert scalar property to item list in MSBUILD

Hello, everyone! What is the most terse way to convert $(Property) to @(ItemList) in MSBUILD file? ...

SubSonic 3 Regenerate ActiveRecord Class Automatically?

I have a SQLite database and SubSonic3, finally got a clue on how to generate the .cs from the .tt in Visual Studio. My stuff builds now. I can kick off MSBuild automatically to build my project, but I would like to add a pre-build event to regen the ActiveRecord.cs cleanly so any database changes end up there for future Unit tests. H...

Why does processing multiple individual targets take longer when Nant is directed to process them from a single target?

I have a nant build script that specifies the compilation of various Visual Studio solution files. <target name="compile.solution1" description="Compiles solution 1"> <msbuild project="${src.dir}\Solution1.sln" verbosity="${build.verbosity}"> <property name="Configuration" value="${build.config}" /> <property name="OutputPath" val...

Can Hudson export/set/use my environment variables for the msbuild task?

I am running hudson on Vista and calling MSBuild for C++ solutions (VS 2008). I have not been able to find a way to export the existing user or system environment variables. I can manually set env variables via hudson, but I prefer not to do that - I want to use the existing ones that are already set. Is there a way to do this? E...

How to build a .NET website using Nant

I usually use web applications in Visual Studio and the MSBUILD taks in Nant builds them without any problems: <msbuild project="MySolution.sln"> arg value="/property:Configuration=release" /> </msbuild> I now have a website (not a web application) in a VS Solution and it won't build - I get a lot of namespace errors. Should I be a...

Dividing work of MSBuild into projects

I'm starting to create a MSBuild scripts for my products, and I've encounter a dilema. The code is divided into around 25 projects, some wll require obfuscation, some will require strong-name signing; others will require linking into a single file. All these projects should result in 3 products, with 3 setups. The question at hand is ...

Installing a windows service on remote machine using given username

What is the best way to install a windows service written in C# (in the standard way) on a remote machine, where I need to provide the username and password it should run as? I am going to run it from MSBuild as part of integration tests. EDIT: I don't have an msi and I don't want to create one. ...