msbuild

MSBuild's XmlMassUpdate task in NAnt?

I have created an MSBuild tasks for building my projects, but for various reasons I wan't to switch to NAnt. Is there some task that would be equivalent to MSBuild's XmlMassUpdate in NAnt? If possible I would like to use the same xml replacement file I used with XmlMassUpdate. (for more info about XmlMassUpdate, here's a short usage I ...

[MSBuild] How to set 'condition' using a condition stored in a property?

I have a condition such as 'a==1' stored in property $(c) and I wanna used it as the condition for task Message like below code: <PropertyGroup> <aa>1>2</aa> </PropertyGroup> <Target Name="t"> <Message Text="122333" Condition="$(aa)" /> </Target> Error was raised! So, how can I do it? Please help! ...

How to integrate conditional logic in postbuild events

Hi I have a visual studio project which includes postbuildevents in the following form: MyTool.exe $(ProjectDir)somesrcfile.txt $(TargetDir)sometargetfile.bin Now I want to add some logic saying that these steps are taking place only if the files have changed. In peudocode: if (somesrcfile.txt is newer than sometargetfile.bin) { My...

The command "".\Bin\mt.exe" -nologo -manifest ... exited with error code 3 in CCNET

I am trying to build my VS 2008 project in CCNEt and getting the below error <message level="high"><![CDATA[".\Bin\mt.exe" -nologo -manifest "C:\MyProject\MyFile.exe.manifest" -outputresource:"C:\MyProject\bin\Release\MyFile.exe;#1"]]></message> <message level="high"><![CDATA[The system cannot find the path specified.]]></message> <e...

[MSBuild] How to convert NAnt function "path::combine(path1, path2)" to MSBuild?

I need to convert the function "path::combine(path1, path2)". Please help me if you have some idea. Thank you! ...

msbuild/clickonce publish files generated during the build

As a part of my build process I generate some files that should be included when creating a clickonce deployment. Here is a blog post of someone telling you how to include items that's not part of the project. However, as someone mentions in the comments of that blogpost, it won't update the deploymentmanifest when you do it in the "Be...

TFS Automated Builds to Code Packages

I would like to hear the best practices or know how people perform the following task in TFS 2008. I am intending on using TFS for building and storing web applications projects. Sometimes these projects can contain 100's of files (*.cs, *.acsx etc) During the lifetime of the website, a small bug will get raised resulting in say a sty...

Having trouble running code analysis from command prompt with msbuild

I'm using VS2010 RC while targeting .NET 3.5. I can run code analysis via Visual Studio without a problem. However, when I try to run code analysis on our CI server it isn't getting executed. When I attempt to build using msbuild 4.0 I get the following exception: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalys...

ClickOnce and mageUI adding custom file folder problems

What I do: Publishing .Net 3.5 application via VS, or msbuild (whatever), and now I need to insert to the published application separate directory (Modules - not added as a reference to the project - our project architecture does not allow this). So I'm copying the folder to published location then runs mageUI.exe select the application ...

[MSBuild] Problem with setting properties 's values.

Let's consider the below example. There, I have: target MAIN call target t then call target tt. target t call target ttt, target tt call target tttt. target t define property aa, target ttt modify aa. target tttt try to print property aa 's value. in short we have: MAIN -> {t -> {ttt->modify aa, define aa}, tt -> tttt -> print aa} B...

[MSBuild] How to check if a target exists or not before calling it?

Is there a way to check the existence of a target so that we can call it only when it exists? ...

Silverlight project builds in VS2008 but fails when using MSBuild

Hi, We have 2 Silverlight projects in the same solution; SLGlobalResource and SLData. SLData references SLGlobalResource (using references > add reference > projects). When we build it in debug within VS2008, everything builds fine and all is good. But when we build it using: msbuild TheSolution.sln /p:Configuration=Debug /t:rebuild...

MSBuild: building website using AspNetCompiler - adding references?

Hi, I'm attempting to build a ASP.NET website using MSBuild - specifically the AspNetCompiler tag. I know that, for my project, I need to add some references. Within Visual Studio I have several references, one is a project reference and the others are some DLLS (AjaxControlToolkit etc). I'm happy not referencing the project and referen...

Building Web Application project using MSBuild from command line on 64-bit: missing targets file

Building a solution containing a web application project using MSBuild from powershell like this: msbuild "/p:OutDir=$build_dir\" $solution_file Works fine for me on 32-bit, but on a 64-bit machine I am running into this error: error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplication...

TFS Solution build cascading to several other builds even when common components were not modified

Hey all, here is the issue I am currently trying to work through. We are using Team Foundation Server 2008, and utilizing the automated build support out of the box. We have one very large project that encompasses a number of interrelated components and web sites, each of which is set up as a Visual Studio solution file. Many of the...

what's an effective way to build a csproj file in code?

I'd like to avoid a command line for this. I've been using the MSBuild API ( Microsoft.Build.Framework and Microsoft.Build.BuildEngine) with code that looks like this: this.buildEngine = new Engine(); BuildPropertyGroup props = new BuildPropertyGroup(); props.SetProperty("Configuration", "Debug"); this.buildEngine.RegisterLogger(this....

How to search for files containing a particular text string?

How to search for files containing a particular text string using MSBuild? ...

How to propertly reference a namespace for Microsoft.Sdc.Tasks.XmlFile.GetValue

Hi, i want to use MSBuild to insert a custom xml element into web.config. After looking up online, i found such solution: 1) Store element in the .build file in projectextensions <ProjectExtensions> <CustomElement name="CustomElementName"> ... </CustomElement> </ProjectExtensions> 2) Retrieve the element with GetValue <Target na...

WiX: .Net 3.5 prerequisite

I have a WiX installer that I would like to check for .Net 3.5, and install it if it does not exist. I have the following lines in my wixproj file: <BootstrapperFile Include="Microsoft.Net.Framework.3.5"> <ProductName>.NET Framework 3.5</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.3.1"> ...

How to pause in the middle of the execution of a MSBuild script?

I tried to use: <Exec Command="pause" /> But that doesn't work. Please help to to pause! Nam. ...