msbuild

How can I define properties dynamically and pass them to another target in msbuild?

I am trying to reuse a task in an Ant way: <Target Name="Release"> <Message Text="Env: $(Env)"/> </Target> <Target Name="ReleaseIntegration"> <CreateProperty Value="Development"> <Output TaskParameter="Value" PropertyName="Env" /> </CreateProperty> <Message Text="Env: $(Env)"/> <CallTarget Targets=...

How can I copy files as a different user from msbuild?

I am trying to copy files to a remote server, the account I am running my build server doesn't have permissions though. How can I do it using different credentials? ...

Visual Studio 2008 locks dll in bin folder and doesn't let go of it

Hi, I am working on a solution consisting of 8 .NET projects. Since I am practicing TDD, I have to re-compile my solution very often. Lately I have been getting the following error about every second time when trying to compile: Error 2 Unable to copy file "obj\Debug\Zeiterfassung.Tests.dll" to "bin\Debug\Zeiterfassung.Tests.dll...

Working with MSBuild and TFS

I'm trying to work with MSBuild and TFS. I've managed to create my own MSBuild script, that works great from the command-line. The script works with csproj files, and compiles, obfuscate, sign and copies everything that's needed. However, looking at the documentation of TFS & Team Build, it appears that it expect solutions as the "inpu...

How can I prevent Visual Studio from locking the xml documentation files in the bin directory?

My visual studio solution includes a web application and a unit test application. My web application uses log4net. I want to be able to use msbuild from the command-line to build my solution. However, whenever I build the solution from the command-line, I get build errors because it can't copy log4net.xml to the test project's bin direct...

build vs2005 solution with msbuild from .net 3.5

I have msbuild proj file which should build solution created on Visual Studio 2005 and containing both C++ and C# project If I need to build the solution with msbuild which comes with .NET 3.5, what should be added into proj file ? Thanks in advance ...

Why would autoconf/automake project link against installed library instead of local development library?

I'm creating a library libgdata that has some tests and non-installed programs. I am running into the problem that once I've installed the library once, the programs seem to be linking to the installed version and not the local version in ../src/libgdata.la any longer. What could cause this? Am I doing something horribly wrong? Here is...

MSBuild Error: The attribute "Remove" in element <ProjectReference> is unrecognized

I'm attempting to setup a .csproj file to have a conditional item group which will remove all of the elements in the <ProjectReference> item group. For example: <ItemGroup> <ProjectReference Include="..\..\..\..\Projects\Registrar\Ucsb.Sa.Registrar.Common\Ucsb.Sa.Registrar.Common\Ucsb.Sa.Registrar.Common.csproj"> <Project>{1ED...

MSBuild vs. NAnt for a mixed 2005 and 2003 codebase

We are currently maintaining a huge code base with hundreds of *.proj and perhaps 50 solutions with interconnected dependencies. All of our code base is either .net or legacy C++. Are current build process is a nested command line script that does automated source control pulling and then builds each solution in turn by calling devenv....

How to chain TFS builds?

I have a scenario where I want to call one TFS build from another, the first one does the build and the second one does staging. This will allow me do multiple custom staging for the same solution. I know, I can pull this off with an exec task in the second build and call tfsbuild.exe to queue a build from the first build definition. Bu...

How to override vbproj DebugSymbols with msbuild?

Regardless of the DebugSymbols setting in my various vbproj files I want to generate .pdb files. I have a msbuild project named FX.proj that looks like this: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; <ItemGroup> <ProjectReferences Include="C:\product\forms.vbproj" /> <ProjectReferences Include=...

WIX MSBuild automation help - solution best practices

I know there are many questions out there regarding this same information. I have read them all, but my brain is all turned around and I don't know which way to go. Plus the lack of documentation really hurts. Here is my scenerio. We are trying to use WIX to create an installer for our application that goes out to our dealers for our pr...

How to convert vdproj file to WiX format?

Hi all, I need to convert a vdproj file to WiX format so that I can get it building using msbuild. One solution was to call the devenv executable from msbuild and build the vdproj file from there but that's just nasty. I thought that I would try manually converting the file to WiX format but looking at its contents scared me quite a bit...

CruiseContol.Net MSBuild Errors

I have msbuild building my solutions. msbuild is being called inside a batch file and the file is being called in cruisecontrol.net. When msbuild throws an error, these errors appear in the logs but cruisecontrol still builds successfully since the batch file was executed successfully. Is there any way I can have cruisecontrol change it'...

MSBuild - Target Dependent Imports

I want to make an import dependent on which target I call MSBuild with from the commandline but I'm having a hard time figuring out how to programatically access the target name(s) the .proj file was called with i.e. <Import Project="some.targets" Condition="$(TargetName) == myTarget"/> In general is there a way to dump all defined env...

<msbuild> task or msbuild.exe with NAnt?

It looks like there are (at least) two options for getting nant to use csproj files: using the task of NAntContrib or using msbuild.exe directly (e.g., codecampserver). Am I reading this right, and if so, what is the advantage of using msbuild.exe over the NAntContrib task? ...

Can Pre-Build Events Raise Warnings?

Hi, I have a custom tool which is set up as a pre-build event, it does some multi-language processing on the source code before it builds. I was wondering if it was possible for that tool to generate warnings which can be seen in visual studio's list of build warnings, either by outputting a specific string to the console (or by some ...

Using MSBuild Conditions on COMReferences

How can I specify a Condition for a COMReference in my *.csproj file? The following does not appear to work: <COMReference Include="SomeComLib" Condition=" '$(Configuration)' == 'Debug' "> ... </COMReference> I have some COM references in a C# project in Visual Studio 2008. I would like them to automatically use non-isolation mode...

different results using msbuild project.sln build vs vs2008 IDE build

I'll try and make this simple. I have a solution file Nexus.sln that contains 3 projects. Dsl, DslPackage and NexusSetup. NexusSetup depends on Dsl and DslPackage. The dependencies are setup in the IDE under Project Build Order, they are listed as Dsl, DslPackage, and NexusSetup. in the Dependencies section NexsusSetup dependes on Dsl an...

Ways to speed up build time? (C#/Unmanaged C++)

A legacy app I am working on currenty takes ~2hours to build. The project has about 170 projects with 150 or so being unmanaged C++ and the other 30 C#.Net 2.0. What are some suggestions on ways to improve build times for something like this? ...