msbuild

When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build?

When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build? For example "TargetPath" I know i can pass it in as part of the task XML <MyTask TargetPath="$(TargetPath)" /> But i don't want to force the consumer of the task to have to do that if I can access the variable...

Problems with builds on TFS 2010 and resolving dependencies

Hi I have a project that works great on my machine (and production servers). It's a VS2010 project running C#3.5. When letting my build server build the solution it can't resolve a couple of my third party dll's. Error message: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The pr...

How do I change a property's value based on a conditional in msbuild?

I would like to change the value of a property if it is a certain value. In C# I would write: if(x=="NotAllowed") x="CorrectedValue; This is what I have so far, please don't laugh: <PropertyGroup> <BranchName>BranchNameNotSet</BranchName> </PropertyGroup> ///Other targets set BranchName <Target Name="CheckPropertiesHave...

msbuild array iteration

<ItemGroup> <!-- Unit Test Projects--> <MyGroup Include="Hello.xml" /> <MyGroup Include="GoodBye.xml" /> </ItemGroup> How do I make a task that iterates through this list and does something? <XmlPeek XmlInputPath="%(MyGroup.Identity)" Query="/results"> <Output TaskParameter="Result" ItemName="...

How to get a changeset SQL query using DB Pro for .net and SQl Server when usinga Team build?

Hi all, I am working on Build Automation via Team Build (TFS 2008). We are using DB Pro with our Web project. I want to get the SQL script for database change-set ,(that has occurred till the nightly build), automatically using MSBuild Script . This script has to bundled in a zip file along with Web Application binaries and pages. Ho...

Dependency issue with MSBuild 4.0 when doing DllImport from C# into unmanaged C++ library

Explicitly setting dependency in VS2010 between unmanaged C++ project and C# project is honored in VS2010, but dependency is ignored in MSBuild 4.0. It is impossible to add a reference to unmanaged C++ project from C# project, afaik. How do i ensure correct build order if a solution contains unmanaged and managed projects? ...

Embed application compilation time stamp

Is there an easy way to configure in a build process to write in the time stamp of the build to be displayed in the application to have something like "This page was last updated: 06/26/2010" ...

Conditional PropertyGroup in TFSBuild.proj

I am trying to set a PropertyGroup depending on the value of another PropertyGroup: <PropertyGroup Condition="'$(BuildDefinitionName)'=='Dev1'"> <DeploymentServer>DEVSERVER</DeploymentServer> </PropertyGroup> <PropertyGroup Condition="'$(BuildDefinitionName)'=='Main'"> <DeploymentServer>MAINSERVER</DeploymentServer> </PropertyG...

How to use Nant and MSBuild to build debug deployment

Hi I have a Nant build script which referrences 30 other build scripts. Each build script referrences a visual studio solution using MSBuild. Each solution has 3 to 5 projects in. Some projects are Class Librarys and some are Web Apllications. The projects reference other projects both in their solution and out of their solution, so...

How can I pass a parameter through MSBuild to the compiler?

I'm using the line below to have MSBuild build a Delphi 2010 groupproj: MSBuild C:\src\myprojgroup.groupproj /target:Build /p:config=Release I can't figure out how to modify the line above so that I can pass this argument -EC:\mypath to the compiler (bcc32.exe). I've spent a fair amount of time trying to find this on the we...

Command which gives to create a zip folder to desired destination in msbuild

Want a command which gives to create a zip folder to desired destination in msbuild. PLease Help its urgent.. For more clarification of my question : I have to include this ZIP task in to my build, where ever the developer pulls my code and builds it , how can i include these task into his machine , is there any other way ? is there a ...

Silverlight solution builds in VS2008 but fails with MSBuild

I have a Silverlight solution that I want to create a build script for. I have a simple script that looks like this call "c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" msbuild %CD%\V1\Incentive.sln /target:Rebuild /property:Configuration=DEBUG;WarningLevel=2 msbuild %CD%\UI\IncentiveUI.sln /target:Rebuild /propert...

Good-practices: How to reuse .csproj and .sln files to create your MSBuild script for CI ?

What is the painless/maintainable way of using MSBuild as your build runner ? (Forgive the length of this post) I was just trying my hand at TeamCity (which I must say is awesome w.r.t. learning curve and out of the box functionality). I got an SVN > MSBuild > NUnit > NCover combo working. I was curious as to how moderate to large proj...

MSBuild get %(RecursiveDir) directive from custom task parameter

I'm developing a custom MSBuild task by inheriting from the base Task class. My task calls the Copy task declared in Microsoft.Build.Tasks.dll setting the DestinationFolder property in the process. My custom task has a property called DestinationFolder declared as public ITaskItem DestinationFolder { get; set; } When calling this tas...

MSBuild - setting a reference path

I have several assemblies my project is dependant upon. These are stored in the Project's directory under the "Dependencies" folder. So something like this. Solution - Project - Dependancies FunkyAssembly.dll - bin - Debug - Release SomeCode.cs I've referenced FunkyAssembly.dll us...

Build VS2010 solution file from msbuild command line.

I want to build my VS2010 .sln file (projects are .net 4.0) with msbuild from the command line. I expected this to work... >C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe application.sln However I get this message: "Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating th...

MSTest exception: Unit Test Adapter threw exception: Type is not resolved for member...

In my project I write tests using Microsoft's unit testing framework. All of my tests pass when I run them from Visual Studio but when I run the tests from MSBuild all of the tests fail with the following erorr message: Unit Test Adapter threw exception: Type is not resolved for member SomeType,*SomeAssembly* Version=assemblyVers...

PowerShell and MSBuild difference

I am new to both MSBuild and PowerShell and am trying to wrap my head around where these stand with respect to deploying ASP.NET applications. Can someone explain the difference? (I hope I am comparing apples and apples) ...

BuildShadowTask "Could not load file or assembly"

My Solution Built fine last Friday. Today I fired it up and I am getting this error message: Could not load file or assembly 'MyApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. This is failing in my Smart Device Unit Test project. I have Googled...

MSBuild reports that build Failed however the log reports Build Successful

I'm having trouble with an MSBuild script as it's executing correctly, but in TFS Build Explorer it reports a Fail (red X icon). However, despite all the builds reporting failed, if I examine the logs, they look fine, and end with : Done building target "EndToEndIteration" in project "TFSBuild.proj". Done Building Project "C:\Builds\...