msbuild

Is it possible to batch on item metadata?

Given the following MSBuild project file: <Project ToolsVersion="3.5" DefaultTargets="DoA" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <ItemGroup> <A Include="1.txt"> <Define>B=2;C=3</Define> </A> <A Include="2.txt" /> </ItemGroup> <Target Name="DoA" Inputs="@(A)" Outputs="out\%(A.Filename).cs...

MSBuild Extension Pack

Is there a way to use the MSBuild Extension Pack with a "local" reference that doesn't require you to run the installer? In other words, can you store the targets in a solution items folder so that every developer doesn't have to install it? ...

Ant doesn't see when msbuild build failed.

Hi, As part of my Ant integration test script, I run an MSBuild build (just executing the msbuild.exe), and it works fine in the positive cases. However, Ant doesn't recognize when the msbuild build fails. How can I make it work? EDIT: I can msbuild by executing the executable: <target name="executeMsbuild"> <exec command="C:...

Running MSBuild script on development machine

Hi, I have an MSBuild script which performs a lot of tasks, as it is run on our build server. I want the script to be run each time a developer builds from Visual Studio on their local development machine, so that a) the build process they are runnning locally is the same as that run by the build server so any problems in the build c...

Setting tail of AssemblyVersion to be TeamCity $(build_number)

I want to set the Assembly number to the following AssemblyMajorVersion.AssemblyMinorVersion.AssemblyBuildNumber.AssemblyRevision YYYY-MM-DD-XXX Where XXX is my TEamCity $(BUILD_NUMBER) I can assign the value of $(BUILD_NUMBER) and see that is has been set using a text message e.g. However, When I inspect $(MaxAssemblyVersion), I g...

Can you use multiple working folders with TFS?

In projects in which the workspace has only one working folder, my build scripts work great. Now that I am working with a new project that required 2 working folders, all of the checkout and checkin commands of my previous script fail, with no files found. Obviously, I'm not understanding a critical part of the implementation of the wor...

Path Error, YUI compressor .NET

I'm trying to use YUI compressor for .NET as an MSBUILD event $(MSBuildBinPath)\msbuild.exe "$(ProjectDir)MSBuild\MSBuildSettings.xml" \p:CssOutputFile="$(ProjectDir)styles.css" \p:JavaScriptOutputFile="$(ProjectDir)scripts.js" This is my Pre-Build event command line... In the output it seems like the task succeeds because it says "Fi...

MSBuild and C++

If I am content to not support incremental builds, and to code everything via Exec tasks, is there any reason I can't build C++ binaries with an MSBuild script? I know VS 2010 will actually have support for a true MSBuild based project file, but what I'm trying to do is to integrate an old embedded VC++ 4.0 workspace into an overall lar...

Is it possible to restore a SQL Server database from a virtual drive?

In SQL Server Management Studio, if I attempt to restore a database from a backup file with a command like: RESTORE DATABASE somedatabase FROM DISK = '<virtual disk>:\<path>\<backup file>'; I get a "file not found" error. I'm creating with the "subst" command. But if I replace with a physical disk and with the complete path, the ...

set vcbuild environment through msbuild

I have an msbuild project file that is used for building several C++ projects (*.vcproj). Here's a part of a typical project file, in which global environment variables for the build are overridden as properties: <PropertyGroup> <MYBINDIR>d:\buildsysroot\bin</MYBINDIR> <MYLIBDIR>d:\buildsysroot\lib</MYLIBDIR> ... </PrpertyGroup> ...

msbuild and visual studio project configuration problem

I have a solution containing a lot of projects and installer projects. One project uses a third party package. The package comes with a native DLL and a .net wrapper DLL. In order for the code to work, the .net wrapper DLL needs to find the native DLL in runtime. But the code never directly refers to the native DLL in compile time (the c...

Is there a way for a program to detect if it was called by MSBuild or not?

I'm looking in the environment but I can't see anything that I could use. Any ideas? I'm trying to submit a patch for in Waf a bug that only appears when running the build under MSBuild (...yes I know, it sounds crazy but we're driving our Teamcity server using MSBuild). ...

TeamCity build number reporting from MSBuild

Hi, I'm reporting a build number to TeamCity from my MSBuild script using the following TeamCity task: <TeamCitySetBuildNumber Condition="'$(TEAMCITY_BUILD_PROPERTIES_FILE)' != '' " BuildNumber="$(UpdatedVersionInfo)" /> This is called from an UpdateVersion task which generates UpdatedVersionInfo from a global AssemblyInfo.cs This a...

How does MSBuild find the Delphi search path?

If I launch the RAD Studio command prompt and run msbuild /t:Rebuild in a project directory, msbuild will show the full command line to invoke dcc32, including all path settings. Which kind of magic does MSBuild use to find the search paths, based on the IDE settings (stored in the registry) and the project file (which contains pla...

How to implement dependency checking for C/C++ sources

I started adding support for a 3rd party toolchain (IAR Compiler) to Visual Studio 2005. So far I've managed to implement the required msbuild tasks (Compile, Link and Assemble) and the Visual Studio Add-in to support the *.proj file. The next hurdle is handling dependencies for the headers. I'm not sure what the best way to go about t...

Team Foundation Build - resolving cross solution project references

We have a shared project referenced across multiple solutions which, when encountered by TF build causes: 'error MSB3202: The project file "......\trunk\\\sharedproject.csproj" was not found'. This is fine as the directory structure on the build server does not reflect that of source control. Is it possible to modify the build file...

Determine If Solution Compiles using MSBuild and PSake

Hi, I have put together a PSake (v2.0) build script, and the script is setting the $psake.build_success property as true even thought the call to MSBuild fails. Can anyone advise me on how to alter the script so that the $psake.build_success property will correctly return false when the MSBuild call fails? My PSake build script is a...

MSBuild AfterPublish Target

I want a particular file copied in with the published output of my web project. I tried changing the Build Action to Content and changing the Copy to Output Directory to Copy always. This works fine except that it buries it down in a sub folder the same way it is in the project. I do not want it buried down in a sub folder. I want it si...

How do you determine what files are associated with a label in TFS?

I am unsure if I have a bug or my understanding of labeling in TFS is faulty. I have a situation where I have a file I expect to have a specific label assigned to it. I have 2 projects, the main project and the 3rd party project. I apply a label to both. When I do a find for a specific version on one file in 3rd party project using...

Code coverage on TFS 2010 Beta 2

When trying to get TFS 2010 to run tests with codecoverage we get the error in the MSTest.exe output stated below. When running locally in VS 2010 Beta 2 the code coverage runs just fine. Have any of you guys experienced this and/or know how to fix it? Thanks in advance /Klaus Partial output from MSTest.exe: Summary ------- Test Ru...