msbuild-task

Required tag in Custom MSbuild Tasks

How do you know if a value was passed in on a property that does not have the [Required] flag. What will be the value of an string that is not required and was not passed in? If it is an empty string then how do you know the difference from a empty string sent by the caller? ...

Filter on Category for NUnit MSBuild tasks?

I'm setting up a MSBuild project to run some NUnit test, using the MSBuild Community Tasks Project. With these settings I'll be able to run the NUnit tests: <Target Name="Test" DependsOnTargets="Build"> <CreateItem Include="$(ProjectTestDir)\$(ClassLibraryOutputDirectory)\*.Tests.dll"> <Output TaskParameter="Include" ItemName="Test...

MSBuild Annoyances (or blatant ignorance on my part)

Hi all, In reworking our deployment process I moved over to using an MSBuild project in place of our existing batch files. All of the major elements are in place, and I was looking to cut out a step or two but ran into a snag. I'm creating a property called OutputPath using the CombinePath task, and, while I can access it with no is...

MSBUILD Batching Tasks Executes Each Statement in a batch

I have the following task in my MSBuild script: <Target Name="ZipStates"> <Message Text="CREATING ZIP FOR %(StateSet.Name)" /> <CreateItem Include="$(StagingArea)\v$(VersionString)\States\%(StateSet.Name)\v$(VersionString)%20%(StateSet.Abbreviation)XTend\**\*.*" > <Output ItemName="ZipFiles" TaskParameter="Include"/> ...

Choosing which Service Pack of the .Net Framework to build against

I have read many questions (and answers) around here that had similar sounding terms in them as this question, but all of them ended up being about building against different major versions of .Net. I am in much deeper trouble, unfortunately. Here is the story. Our customers use version 2.0 of the .Net framework. Just 2.0, no service pa...

create smart device cab through msbuild

Is it possible to use an msbuild task to build a smart device project into a cab file for deployment. I've seen a couple of pages on the web: http://guystarbuck.blogspot.com/#115584006223003606 http://blog.opennetcf.com/ctacke/2008/09/18/AutomatingCABFileGenerationWithMSBUILD.aspx but I can't believe that you have to go to that much t...

How to execute Oracle utility in MSBuild

I want to execute the oracle's import utility in MSBuild as a task. Please give a detailed answer. I am a beginner. ...

Using msbuild to publish my sln file

My requirement is as below Execute MSBuild on a sln file configured to publish as a website, and then copy the precompiled website files to a webserver ( am using cc.net ) When I try the following cmd on msbuild, msbuild abc.sln /t:publish /p:Configuration=Release I get the following error Web projects do not support the "Publish" t...

Running portion of a TeamBuild as x64 [for xunit.net tests]

Using Team Foundation Build, I'm invoking the xunit.net xunit task, which is /platform:AnyCpu, but my TeamBuild invocation of the TFSBuild.proj is vanilla. I have a number of tests that are x64 specific (`/platform:x64'), which choke with an ImageFormatException. I have also a test asembly that's marked x86 so it can't be all or nothing...

How to invoke the same msbuild target twice with different parameters from within msbuild project file itself.

Dear ladies and sirs. I have the following piece of msbuild code: <PropertyGroup> <DirA>C:\DirA\</DirA> <DirB>C:\DirB\</DirB> </PropertyGroup> <Target Name="CopyToDirA" Condition="Exists('$(DirA)') AND '@(FilesToCopy)' != ''" Inputs="@(FilesToCopy)" Outputs="@(FilesToCopy -> '$(DirA)%(Filena...

How to copy a folder recursively with out overwriting the previous one

what i need is i have linked my project with the cruise control, so when ever a build happens i want to copy the bin folder to a seperate destination folder with version number. That is when the project build happens for the second time i dont want to replace the bin folder of the first build i want to save this with another version numb...

Return output from an MsBuild task?

I'd like to calculate a path in a MsBuild task, to be used by another MsBuild task. What is the best way to accomplish this? Setting a environment variable, printing to Console, ...? ...

msbuild not updating revision number using AssemblyInfoTask

After much Googling, I found a custom task that could increment my revision number while building my project using msbuild. However, the revision number is not being updated. Without modifying my "Microsoft.VersionNumber.targets" file, the build fails and says "The version specified '0.0.090903.0' is invalid". So I found this link which ...

How to install msi on remote machine in msbuild without using psexec?

I have searched all the custom tasks in Extension Pack and Community Tasks and finally found a task called Msi.Istall in SDC Tasks. But the documentation is bad and causes problems. I get errors regarding the properties passed to the installer. Below is my Install target : `<Target Name="Install"> <!-- Copy the MSI package into ...

Setting an item metadata using a property

I have been trying to make a task in my TFS builds more generic, and one of the things I am trying to do is copy some files to different directories depending on the build using the task. I toyed with the idea of using properties, but I couldn't think of a way to do that cleanly, so I tried to go with using item metadata, as I've been ab...

Custom targets are skipped after first run in TFS build

I have a custom target (a group of copy tasks, among others) in my build that I need to call a couple of times to effect change in different places. However, this only runs the first time it is called, after which TFS build skips the said target. The process goes as follows: <!-- Copy some files to another location --> <CallTarget Targ...

MSBuild Task syntax for deleting files

I'm trying to write a MSBuild Task that deletes the Obj directory and PDBs from my bin folder on my production build scripts and can't seem to get it to work right. Does anyone have an example where they do this or similar, or a link to a simple example of removing files and a directory with MSBuild? ...

Svcutil.exe MSBuild Task

Is there a task in MSBuild to execute svcutil.exe? Or is there a definitive wrapper task somewhere? ...

MSBuild TFS Build Number

Hi, I have been using SVN for a little while now. recently on a project I am using TFS. With the builds I like to append/update the build version number on the project output. I do this on the masterpage so that it is clearly visible on the application. Since the application could be running on multiple machines, it is handy informat...

ASP.NET: Execute MSBuild tasks after publishing

I have an ASP.NET project. There is a 'Publish...' option in the context menu of the project (Visual Studio 2008). Can I add some custom MSBuild tasks that will be performed each time after publishing? If not, what is the best way to write MSBuild script that will publish the project (the same way as 'Publish...' option) and then execu...