msbuild

Future considerations for NUnit and NAnt

During .NET v1 days, I have tried without much success to convince colleagues to develop test-driven and automated-build work habits using the additional tools of NUnit and NAnt. When .NET Framework 2.0 and Visual Studio 2005 Team Suite came into picture, I was able to "force" my team into writing tests and provide themselves with visual...

MSBuild, example that filters entire solution of .cs files

Hi, I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension. how do I run the build? where do you usually store the build also? ...

Checkout from TFS with MSBuild

What's the easiest way to checkout a file from our TFS with MSBUILD. From what I can see it's to shell out to TF.EXE and manually call the checkout command. Is there really no built in command?! ...

Is it possible to use MSBuild to build a .NET 1.1 VB project w/ Crystal Reports?

I have a project with Crystal Reports files that doesn't seem to build correctly if I upgrade it to VS 2005 and .NET 2.0. I think the reason is that the new version of Crystal Reports is incompatible with the older report format. Since I am now running Vista, and .NET 2003 doesn't work correctly on Vista, I want to be able to build usi...

Error "MSB3176: Specified minimum required version is greater than the current publish version"

I've got build server running CruiseControl.NET and recently it started throwing this error on one of my projects (.NET 2.0, C#): MSB3176: Specified minimum required version is greater than the current publish version. Please specify a version less than or equal to the current publish version. in Microsoft.Common.targets(2238, 9) I...

MSBuild: Specifying a target from the command line

I have an MSBuild task to build a specific project in a solution file. It looks something like this: <Target Name="Baz"> <MSBuild Projects="Foo.sln" Targets="bar:$(BuildCmd)" /> </Target> From the command line, I can set my BuildCmd to either Rebuild or Clean and it works as expected: msbuild /target:Baz /property:BuildCmd=Rebui...

"File Not Found" in MSBuild Community Tasks -- Which File?

I'm trying to use the VssGet task of the MSBuild Community Tasks, and the error message "File or project not found" is beating me with a stick. I can't figure out what in particular the error message is referring to. Here's the task: <LocalFilePath Include="C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\As...

MSBuild isnt making the build completely parallel

I have an MSBuild project where within it I have a task that calls multiple projects where I set BuildInParallel = "true" Example: <Message Text="MSBuild project list = @(ProjList)" /> <!-- Compile in parallel --> <MSBuild Projects="@(ProjList)" Targets="Build" Properties="Configuration=$(Configuration)"...

Output all files from a solution in an MSBuild task

In MSBuild, I would like to call a task that extracts all the files in all the project in a specific solution and hold these files in a property that can be passed around to other tasks (for processing etc.) I was thinking something along the lines of: <ParseSolutionFile SolutionFile="$(TheSolutionFile)"> <Output TaskParameter="Files...

NAnt and MSBuild command line woes

Hi, I'm trying to configure NAnt to automate my build process - once I've got this step nailed, I'll be integrating the unit tests. Perhaps I don't exactly know what I want, so please correct me if there is a completely different way of doing all of this... I want two NAnt targets, one to do quick, debug builds to make sure everything...

Problem with dynamically generated C# files in msbuild

I have a source XML file that is used to create C# files that are then compiled as part of a project. Currently I have a BeforeBuild target that runs my XML to C# converter. The problem is that by the time the BeforeBuild step is run the old files appear to have been stored by the build system so the new files are ignored. How can I get...

What is the best way to share Delphi source files among projects?

What is the best way to share Delphi source files among projects? Clarification: We want to use a single source file in multiple Delphi projects. We've been using our SCM tool to put the same file into multiple folders, but this is not a super-elegant experience and we are also considering migrating to a tool that doesn't support this....

Visual Studio - How to remove a reference in Release mode

Hi, I'm developing a library for use in other apps and this library has lots of debugging and logging statements thanks to NLog. Is it possible to exclude the reference to NLog.dll when I switch to release mode? Cheers, ...

Unit test MSBuild Custom Task without "Task attempted to log before it was initialized" error

I have written a few MSBuild custom tasks that work well and are use in our CruiseControl.NET build process. I am modifying one, and wish to unit test it by calling the Task's Execute() method. However, if it encounters a line containing Log.LogMessage("some message here"); it throws an InvalidOperationException: Task attempted t...

What are some of the best resources to learn MSBuild with?

I am looking for any and all suggestions of the best and effective resources that the StackOverflow community has used to better learn MSBuild with an emphasis on integrating unit tests and later static code analysis tools such as FxCop and StyleCop into the build process. I have tried to find good clear documentation on adding unit tes...

Suppressing C++ 'Post-Build Event' when using msbuild

I am using msbuild to build a C++ project and I want to suppress the 'Post-Build Event'. I have tried the following properties with no success: /property:PostBuildEvent= /property:VCPostBuildEventTool= Neither will make any difference and the post build events are still executed. Does anyone know how to suppress these (and potential...

MSBuild copy output from another project into the output of the current project

I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario: Project A - Web Application Project Project B - Dal Interface Project Project C - Dal Implementation Project There is a ...

Why doesn't MSBuild copy as I would expect

I'm needing to script my build. I'm using MSBUILD because of it's integration with VS.net. I am trying to copy some files from the build environment to the deployment folder. I'm using the copy task of MSBuild. But instead of copying the directory tree as I would expect. it copies all the contents into a single folder. I repeat all the ...

"Treat all warnings as errors except..." in Visual Studio

In Visual Studio, I can select the "Treat warnings as errors" option to prevent my code from compiling if there are any warnings. Our team uses this option, but there are two warnings we would like to keep as warnings. There is an option to suppress warnings, but we DO want them to show up as warnings, so that won't work. It appears t...

Whats the best way to handle conditional dependencies in C#

We're building an C# .NET app which will be running on computers sitting inside trucks. We need to talk to Digital IO ports on the truck computers which do not exist on our developer machines, so I need to write a dummy library which will be included in our dev builds, but will be replaced with our actual Digital IO library when we do r...