msbuild

Why doesn't MSBuild ItemGroup conditional work in a global scope

I'm desperately curious why I am unable to create an item in a global scope based on a metadata condition which works as expected inside a target. For instance, this works as expected: <ItemGroup> <TestItems Include="TestItem1"> <TestFlag>true</TestFlag> </TestItems> <TestItems Include="TestItem2"> <TestFla...

MSBuild & VSIXmanifest Env Dependencies

Hi, I'm having trouble getting a VisualStudio extention project to build under hudson. The problem is that the primary project contains a source.extention.vsixmanifest which, at some point, is moved to obj/Debug/extention.vsixmanifest. However this relative path is all that's output when the build fails not being able to find the file (...

How do I add a custom build target to a Visual C++ 2010 project?

There are plenty of guides out there which help you mimic VS2008's "Custom Build Step" in VS2010 with MSBuild. However, I'd like my build to be smarter and make use of MSBuild. I've written a little MSBuild task which invokes the ANTLR parser generator. That build task works flawlessly when I run it in a simple test MSBuild file. However...

Configuration File Transformation with Azure Worker Roles

Hi, I've just been upgrading an Azure project to Visual Studio 2010 and have been taking advantage of the new XML configuration transformation feature that is built into VS2010 web projects. It seems to work great with Azure web roles. I even managed to get the Azure project service configuration file to do a similar thing by following ...

Access EnvDTE from msbuild code when building in Visual Studio

When I do a build from Visual Studio, on post-build I execute a PowerShell script from MSBuild using the PowerShell MSBuild Task (http://powershellmsbuild.codeplex.com/). In this PowerShell code I would like to add/modify items to my project using Visual Studio automation (through the EnvDTE object). The exact case is: For each X.asmx ...

Create Msbuild CustomTask that can accept sub xml elements or xml attributes (msbuild 3.5)

I would like to create a custom task that is called in a fashion such as this: <Target Name="Remap"> <ItemGroup> <Entry Key="key1" Value="value1" /> <Entry Key="key2" Value="value2" /> </ItemGroup> <CustomTask Entries="@(Entry)" /> </Target> Or this: <Target Name="Remap"> <Item...

Excluding files with MsBuild ItemGroup

Take, for example, the following msbuild file and directory structure: <Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <ItemGroup> <FileList Include="Tests\**" Exclude="Tests\Folder2\**" /> </ItemGroup> <Target Name="Test"> <Message Text="@(FileList->'%(RecursiveDi...

Alter <ItemGroup> Content Sequence

I have a primary build file that is managed through source control. It contains a project <Import> that adds a project that contains settings unique to the local environment. I want to add a temporary project to my copy of the local project file, so I have the following. Primary Build File: <Project> <Import Project="LocalOptions.x...

Using a project file as a parameter in MSBuild with Hudson

Hi, I'm currently using the Hudson build system with MSBuild steps. As part of the build, I have a project file with various targets in, one of which is to start a build with visual studio. However, I need to pass through a seperate project file to this target in order for it to build, but I keep getting the exception 'MSBUILD : error M...

In TFS Build (MSBuild), how can I only have a specifc project in my drop folder

"Out of the box" the build in TFS will compile a complete solution and put all the "deliverables" from all its project into the drop folder. How can I have only the deliverables from a single "main" project end up in the drop folder, why still having all other projects (which it depends upon) compiled? ...

CruiseControl.Net, MSBuild and NUnit

The CruiseControl.Net documentation advises against using the NUnit task, suggesting instead that NUnit is called within the build script. I'm trying to work out what is the best way to achieve this. I've added a 'RunTests' project to my solution which uses the NUnit MSBuild Community Task to execute the tests. I wanted to add a 'Test...

MsBuild ZIP Folder named by date and time actual

I'm pretty new to MSBuild so please be gentle with me, I need sample for do this: I have a msbuild file, mydeploy.targets, to deploy WebSite in remote machine. I want to do backup (of files of remote machine) for each deployment. I need ZIP a folder in remote machine, for generate ZIP file of all folder (all contents files, folders), ...

Is there any MSbuild task to check if a string contains another string (similar to string.contains)

I have this Msbuild code: <Import Project="A.proj" Condition="$(BuildDefinition) =='Dist Staging to Dev' Or $(BuildDefinition) =='Dist Staging to Dev(Services Only)'"/> But I was wondering if is there anything similar to check if an string contains some text to get something similar to: <Import Project="A.proj" Condition="$(BuildDefi...

In place compilation of a web site inside a VS 2008 solution file using MSbuild

Is there is place where I can specify option for an in-place compilation of the website using MSbuild http://msdn.microsoft.com/en-us/library/ms178731%28v=VS.80%29.aspx. ...

Team Build vs MSBuild?

can some one explain the difference between Team Build + MSBuild ? also how do they differ in relation to VS2008 and VS2010? ...

How to aggregate outputs from a dynamically generated set of projects into a single folder.

I need to collect into a single folder all test assemblies, with their dependencies, and configuration files. The process should preserve the directory structure from the output of each test project. We have a solution that requires manually attaching test projects to a master project, but our solution has far too many projects for this ...

Stop msbuild process if a target fails

Let's say I have three targets A, B and C. C depends on B. B depends on A. If I run msbuild /t:C mybuildfile.xml, it will execute target A, B and C in order. How do I set up to make sure C and B won't get executed if there is anything failed in A? ...

Place all output dlls in common directory from Visual Studio

I have a couple of different solutions, in which some projects may depend on output from projects in other solutions. To manage this, I've been copying dll files from the /bin/ folder in each project to a shared library location after build, and then copy/reference them from there to the dependent project. However, as the library soluti...

PSake Error Executing MSBuild Command

Hi All, I have 3 projects in the solution, A WPFApplication and 2 ClassLibrary projects When i build the Solution i get error below.. properties { $base_dir = resolve-path . $build_dir = "$base_dir\build" $buildartifacts_dir = "$build_dir\BuildArtifacts" $sln_file = "$base_dir\Hello.sln" } task default -depend...

Configure TeamCity to follow OutputPath directives in csproj files

I'm setting up TeamCity to build some solutions whose projects have an OutputPath directive that redirects the build to ../../bin/Release or ../../bin/Debug. The solutions obviously build fine in Visual Studio 2008 but when TeamCity builds the solutions it fails to find the assemblies of referenced projects and we get namespace errors (T...