msbuild-task

Targetting different Frameworks using MSBuild gives problems with dependencies

亡梦爱人 提交于 2019-12-04 14:30:35
问题 I have a little project, and I want to have 2 compiled versions of that project: one that is targetting the .NET 2.0 framework one that is targetting the .NET 3.5 framework All is going well; I've put my project under continuous integration (using CC.NET), and I've created 2 CC.NET 'projects'. One project for each target-framework. I won't go too much in (irrelevant) details, but my solution is set up to target the .NET 3.5 framework in VS.NET. I have 2 msbuild-tasks: one task that builds the

Trouble with outputting MSBuild variables

时光怂恿深爱的人放手 提交于 2019-12-04 11:42:50
I'm trying to output the variable from one target, into the parent target which started it. For example, Target 1 simply calls the task in file 2 and is supposed to be able to use the variable set within that. However, I just can't seem to get it to work (wrong syntax perhaps?). Target 1 looks like this: <Target Name="RetrieveParameter"> <MSBuild Projects="$(MSBuildProjectFile)" Targets="ObtainOutput" /> <Message Text="Output = $(OutputVar)" /> </Target> Target 2 is where it reads in the value of the text file and sets it to the property and sets the variable 'OutputVar' to match. This is

How can I use MSBuild Copy Task to Copy To Multiple Destination Folders?

蹲街弑〆低调 提交于 2019-12-04 08:25:21
问题 I'm trying to copy a folder recursively to multiple destination folders using MSBuild's Copy task. I've seen the following question which gave me a good start, but I must be missing something: Msbuild copy to several locations based on list of destination parameter? A snippet from my build file is below: <ItemGroup> <DeployPath Include="\\server1\path" /> <DeployPath Include="\\server2\path" /> </Item Group> <Target Name="Deploy"> <Message Text="%(DeployPath.Identity)" /> <Copy SourceFiles="@

Using MSBuild, how to construct a dynamic string from iterating over files in an ItemGroup?

随声附和 提交于 2019-12-04 06:23:55
I need to create multiple /testcontainer: parameters to feed into a task that exec's MsTest. I have the following : <ItemGroup> <TestFiles Include="$(ProjectPath)\**\UnitTest.*.dll" /> </ItemGroup> for each match in TestFiles I would like to build a string like so: "/testcontainer:UnitTest.SomeLibrary1.dll" "/testcontainer:UnitTest.SomeLibrary2.dll" "/testcontainer:UnitTest.SomeLibrary3.dll" I am trying to use the internals of MSBuild without having to create a custom task, is this possible ? TIA It really depends on the usage of this afterwards. For example the task that you are sending it to

create smart device cab through msbuild

試著忘記壹切 提交于 2019-12-04 05:22:26
问题 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 trouble for something that should be simple! Thanks. 回答1: It is that difficult and, yes, that is lame. 回答2: You can use CAB42 in order to automate the build

Msbuild copy to several locations based on list of destination parameter?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 01:11:49
问题 I got a directory I want to copy to a number of locations. Say I have home.aspx I want to copy it to abc/home.aspx def/home.aspx ghi/home.aspx so two questions for me: How do I define the list abc, def, ghi? How do I execute my Copy task with each element of this list? 回答1: Here is an actual example that I put together that shows what you were looking for: <?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Test"

Visual Studio integrated custom MSBuild task behaviour

半世苍凉 提交于 2019-12-03 21:35:51
I was looking around the net for a NUnit custom MSBuild task that would run on every build and also nicely play with Visual Studio UI (2008 is my version). I found MSBuild.Community.Tasks project that was great, but failed in Visual Studio integration part. What I actually wanted to have is get failed tests displayed as warnings/errors in VS's error list window (and also FAILED project build when tests are not successful). So I wrote my own custom MSBuild task that does the job exactly how I wanted it to be. BUT. The only problem that I have is that normal VS UI error list behaviour is that

How do you integrate ivy with MSbuild

萝らか妹 提交于 2019-12-03 20:54:29
问题 What approach has worked well for you combining IVY + msbuild? Our goal is to integrate IVY into the C#/C++ build process for dependency resolution and publishing. We have tried adding it to custom tasks at the beginning and end of the build and we have tried wrapping the msbuild calls with ant+ apache-ant-dotnet. Other options might be gradle, buildr, rake. What do you use? Thanks Peter 回答1: Most build technologies can use libraries found in a local directory. I'd suggest using the command

How to resolve “Install-Package : The current environment doesn't have a solution open.”

那年仲夏 提交于 2019-12-03 10:49:53
问题 I have a solution having 1 project. Open Package Manager Console, run Install-Package MSBuildTasks But it gave me an error below: Install-Package : The current environment doesn't have a solution open. At line:1 char:16 + Install-Package <<<< MSBuildTasks + CategoryInfo : InvalidOperation: (:) [Install-Package], InvalidOperationExcep tion + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackage Command I don't understand why it comes. Kindly suggest me waiting

Targetting different Frameworks using MSBuild gives problems with dependencies

一世执手 提交于 2019-12-03 09:05:12
I have a little project, and I want to have 2 compiled versions of that project: one that is targetting the .NET 2.0 framework one that is targetting the .NET 3.5 framework All is going well; I've put my project under continuous integration (using CC.NET), and I've created 2 CC.NET 'projects'. One project for each target-framework. I won't go too much in (irrelevant) details, but my solution is set up to target the .NET 3.5 framework in VS.NET. I have 2 msbuild-tasks: one task that builds the solution for .NET 3.5 (simple and easy) one task that builds the solution for .NET 2.0 In this Task, I