msbuild

CruiseControl.NET Set Variable to a dynamic value

Hi *, is there any plug-in or other possibility to set an environment variable in CC.NET 1.4.2 to some generated value. I would like to pass to MSBuild some random value (can be a time stamp where to put some build reports). Afterwords all the generated report files from the randomly named dir will be merged to cc.net report. The probl...

Automated W3C Validation

I'd like to use MSBUILD to check the validity of both the rendered HTML and CSS of all pages in a site, and break the build on errors. Can anyone recommend a strategy to validate HTML and CSS in an automated build? Are there any tasks out there to do this now? ...

Obtain output files from a MSBuild project

Is it possible to obtain a list all all the output files from a MSBuild project? In a simple project, I could do something like <CreateItem Include="$(OutputDir)**\*"> <Output ItemName="AllOutputs" TaskParameter="Include"/> </CreateItem> but my projects are part of a larger build, and all outputs go to a common location, I wan...

Mimicking assembly resolution of the msbuild process.

I am writing a validation tool that checks the versions of files referenced in a project. I want to use the same resolution process that MSBuild uses. For example, Assembly.Load(..) requires a fully-qualified assembly name. However, in the project file, we may only have something like "System.Xml". MSBuild probably uses the project's ta...

TeamCity + MSBuild: Tagging a deployment with a VCS build number

Hi Everyone, I am using TeamCity 4.5.1 to build and deploy an ASP.Net application to development. This is working perfectly so far, however, my manager has asked that I tag the folder with the specific SVN Revision from which the source was compiled. I am using an MSBuild script to do the build and deployment, however, I am unable to ...

How do I have spaces in a MSBuild WebProjectOutputDir?

I am trying to call MSBuild from a command line. Everything was working fine when I was using a path that had no spaces, but now I have a path that has spaces and the command is failing. Command (works): "C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe" /t:Rebuild "C:\Projects\myProject.csproj" /p:OutDir=c:\temp\deploy\funAndGam...

MSBuild vs nant

We were using nant for building our project (10+Class Lib) and a Web Site which was based on the ASP.NET 2.0. Recently we are in the process of moving towards the ASP.NET 3.5. I searched in the net and found that nant doesn't support 3.5. I am also looking in to option of migrating MSBuild. Is the MS Build right candidate for this? I...

Trapping Error Status in MSBuild

As part of some build automation of running xUnit.net tests with MSBuild, I'm running into a case where I need to loop over a batch of items. Inside the loop, I need to detect whether an iteration failed, but I want to continue executing regardless. Then after the batched bit, I need to know whether one or more errors have occurred in ...

certificate issues c#

Hi, We are in a maintainance proect of a large enterprise application. Now we face to a big poblem. The code-singnig certificate for ms.net proect.that we get from the previous company will expire in 20 days. Nobody in our team has the experience related with the certificate issues. We have some problems. we don`t know how to create a...

MSBuild task for combining NUnit or MSTest XML results

I have a set of NUnit XML result files (produced by xUnit.NET via the NUnitXml parameter to the Xunit.Runner.MSBuild.xunit msbuild task pretty much as in http://stackoverflow.com/questions/517560/how-do-i-get-team-build-to-show-test-results-and-coverage-for-xunit-net-test-suit and http://jonnekats.wordpress.com/2009/05/07/integrate-xunit...

NCover Exclusion Rules

I have a couple of questions related to NCover 1) I'm using MSBuild to build my project, in my .proj file I specify exclusions like so: Assembly /Testing.*/i true In terms of the exclusion type, if I have a .exe file would my pattern match it as well as a DLL? 2) Does NCover 2.1.0.0,...

How do I associate a custom default build action to a custom file type in Visual Studio?

I have a language service that I have built for a custom file type. In addition, I have created a custom target (build action) within my MSBuild project files. I am however unable to find any way to associate that build action by default to my custom file extension. For example, if you add a .cs file, the build action defaults to "comp...

What is/are the difference(s) between MSBuild and TFSBuild

Background: We have a TFS server setup where me manage our source code and track work items and bugs. We also have CC.Net setup to help us do CI (mostly just build and run unit tests). We use .net framework 3.5 and VS 2008 I am familiar with MSBuild and use it in our current project to accomplish many pre-deployment and deployment tasks...

Build Quality

We have 3 branches {Dev,Test,Release} and will have continuous integration set up for each branch. We want to be able to assign build qualities to each branch i.e. Dev - Ready for test... Has anyone any experience with this that can offer any advice/best practice approach? We are using TFS 2008 and we are aware that it has Build Quali...

How do I force MSBuild to compile for 32 bit mode?

I'm using MSBuild (via NAnt) to compile a bunch of VB.Net assemblies. Because these assemblies depend on COM Interop, I need to guarantee that they run in 32 bit mode on 64 bit OS's. I can get the executable assemblies to compile to 32 bit by changing the project in Visual Studio, but I'd really like to be able to force all of the exec...

Using MSBuild, how do I set a property to the contents of a file?

I have a file that I set using PowerShell that contains the version number of my build. I need to get this within MSBuild so I can act on it within my build script. It seems simple enough; I just want to take the contents of the file and set a property to that value. I thought maybe doing an Exec task, doing a "more" on my file, and c...

Getting the Content item from a csproj using the MSBuild task

I have an MSBuild file and I am building C# projects like this: <ItemGroup> <ProjectsToBuild Include="./source/ProjectA/ProjectA.csproj"/> <ProjectsToBuild Include="./source/ProjectB/ProjectB.csproj"/> </ItemGroup> <Target Name="Build"> <MSBuild Projects="@(ProjectsToBuild)" Targets="Build"> <Output ItemName="Projec...

TFS Build: Fails to run tests

I am trying to setup a TFS Build, and am having trouble getting my tests to run as a part of the build. I am getting the following weird error message in the build log: D:\TeamBuild\main-production\Company-Test DEV\Sources\root\main-production\customer-projects\Company\sc6-v2\Company-DEV.vsmdi The specified path, file name, or both ...

Targeting both .NET 3.5 and Silverlight

Let's imagine I already have a project building .NET 3.5 assembly. Now I want to build this assembly for Silverlight, and moreover, maintain its Silverlight version with minimal efforts further. What is not acceptable: Creating separate project for Silverlight build What is acceptable: Adding custom directives allowing me to targ...

Why is msbuild and link.exe "hanging" during a build?

We have a few C++ solutions and we run some build scripts using batch files that call msbuild.exe for each of the configurations in the solutions. This had been working fine on 3 developer machines and one build machine, but then one of the projects started to hang when linking. This only happens on the newest machine which is a quad co...