msbuild

Retrieving Assembly Version information for multiple DLLs in MSbuild

All I am fairly comfortable with writing assembly version information for a given project that will output as a DLL. However what I am looking to do now is to go through each DLL in a \Bin folder, retrieve the Assembly information and write it to a versions.txt file. Has anyone managed to acheive a similar goal? ...

svn: Path does not exist in revision

I want to create tag in subversion. On the command line I have tried the following: svn copy http://myserver.mycompany.com:8080/svn/SVN_Main/trunk http://myserver.mycompany.com:8080/svn/SVN_Main/tag/Build-5.4.3.2 -m "Build 5.4.3.2 tag" I get this error: svn: Path 'http://myserver.mycompany.com:8080/svn/SVN_Main/trunk' does not exist f...

How can I delete the contents of a folder from the command prompt in windows?

I am writing a deployment script using MSBuild. I want to clean my web directories prior to copying all the new files in. My current "Clean" target looks like this: <Target Name="Clean"> <Exec Command="del %(DeploymentSet.LocalWebRoot)\* /Q /F /S" IgnoreExitCode="true" /> </Target> This takes an considerable amount of time as e...

Use 32bit "Program Files" directory in msbuild

In 64 bit versions of windows, 32 bit software is installed in "c:\program files (x86)". This means you cannot use $(programfiles) to get the path to (32 bit) software. So I need a $(programfiles32) to overcome this in my msbuild project. I don't want to change the project depending on the os it is running on. I have a solution which I ...

How to automate Visual Studio's Code Metrics feature

I want to automate the process of gathering code metrics on a .NET solution. Is there any way of getting msbuild to run the Code Metrics feature included in VS2008 Development Edition? I may end up using SourceMonitor, but I would like to know if there is a way to use the VS code metrics engine from the command line. ...

Deploy an app.config based on build configuration

I have three custom build configurations { Dev, Qs, Prd }. So, I have three app configs { Dev.config, Qs.config, Prd.config }. I know how to edit the .csproj file to output the correct one based on the current build configuration. <Target Name="AfterBuild"> <Delete Files="$(TargetDir)$(TargetFileName).config" /> <Copy SourceFiles=...

How does visual studio determine what to copy to the output directory with multi-project solutions?

Let's say we have a solution with the following structure: Project.DAL - Data access layer, depends on a lower-level library, e.g. Oracle.DataAccess w/copy local = true Project.BLL - Business logic layer, references Project.DAL as project Project.UI - UI layer, compiles to executable, references Project.BLL, default project When Pr...

Setting the ASP.NET version via MSBUILD

I am trying to create a new website on a remote server via msbuild (I like to call it "msdeploy"). I've downloaded and used the SDC tasks, the MSBuildExtension tasks and the MSBuildCommunity tasks but I simply can't get it right. I figure that WebDirectorySetting (from MSBuild.Community.Tasks.IIS) is my best bet but I can't find the ri...

Build dependency tree from csproj files

I'm currently using msbuild for a solution of over 600 projects. Imagine I change the code for 1 library that is used by 10 projects. Instead of providing all 600 projects to msbuild and let it compile all of them and figure out the dependencys. I was wondering if there was a program or library I could use that would analyse the dep...

How to debug MSBuild Customtask

I'm trying to debug the MSBuild Customtask, that I have just created, but for some reason it never stops at the breakpoint. I've even tried this: public override bool Execute() { System.Diagnostics.Debugger.Break(); And added a break point on that line... I even eliminated all the other code in the method and that did...

Output the name of the current DLL being acted on using MSBuild

This is probably a really stupid MSBuild question but if I have <ItemGroup> <Dll Include="<Path_to_DLLs>\*.dll" /> </ItemGroup> And then <SomeTarget useFiles=@(Dll)> ....do stuff </someTarget> What I want to do is to output the current item that @(Dll) is looping through. Basically I wanting to output the name of the current DLL b...

Using NAnt to build .NET 2.0 projects

I had a .NET 1.1 project, which I built in NAnt using the following snippet: <property name="Refs.dir" value="Refs" readonly="false"/> <property name="OAIDLLs.dir" value="OAI\bin\ServerDebug"/> <solution solutionfile="OAI\CC.OAI.sln" configuration="ServerDebug" outputdir="${OAIDLLs.dir}"> <assemblyfolders> <includ...

MSBuild maxcpucount > 1 Causes build errors

I'm trying to build about 600 projects some are .net 2.0, some are 3.5. I'm using Windows 2003 Enterprise Edition 32 bit with all the latest windows updates. Builds fine when maxcpucount is 1. If I bump it up to try and improve performance it get reference errors. When I look at the project references from where the error occurred it...

MSTest failing in 2008 from build script

Hi guys anyone know what the helll is going on here? ERROR SNIPPET: Loading ..\LocalTestRun.testrunconfig... ..\LocalTestRun.testrunconfig Expected type attribute not found. File ..\LocalTestRun.testrunconfig Line 2 Pos 2. task in a test target in an msbuild script I have seen other people getting the same error with no fixes. ...

Normalizing a list of items in MSBuild

I am trying to get a list of all unit test assemblies under the root of my project. I can do this as follows: <CreateItem Include="**\bin\**\*.UnitTest.*.dll"> <Output TaskParameter="Include" ItemName="Items"/> </CreateItem> However, this will find the same DLLs multiple times since they exist in multiple sub-directories. Is there ...

How to create the inf file for a smart device cab project from command line?

I am trying to get my continuous integration to create build the smart device cab project from within msbuild on the command line. Everything that I have found says to use the inf file (with cabwiz) created when you build the project from within visual studio. Is there a way to create the inf using the .vddproj file so that I can then us...

New Build with MSBuild does not include new class

I normally build my solution with MSBuild in order to keep Visual Studio responsive and save a bit of time. Right now, what I run at the command line is very simple: MSBuild.exe /m "C:\MyProject\MyProject.sln" Up until now, this has worked just fine. However, today I added a class to a class library project whose DLL is loaded via r...

VSTS Unit test - build system

I have developed a build system on MSBuild (NET 3.0) and cc.net to perform continuous integration builds of a Visual Studio 2008 application, however a developer on the team recently added a VSTS unit test project to the mix. Is there any SDK or add-in provided by microsoft to allow this to be compiled on a non-team system build environ...

"Aliasing" tasks in msbuild for intellisense

i'm really hoping i just don't know how to do this, and that 'this' is doable... but one of my biggest complaints to date with msbuild is that they 'break' schema by using dots in the names of the tags. example: I want to bake intellisense into my build using vs 2005 but I can't because the namespace qualified task names are invalid ...

Microsoft Office PIA and how to reference and build correctly from WebApp

All, I am currently trying to build on teamcity, which uses Microsoft.Office.Interop dll. This will build and work fine locally as I have office installed, however when trying to build it on TeamCity it fails as it has no reference. I can't install the PIA distributable as I get an error message saying the Office 2003 is required to ...