msbuild-task

Upgrading TFS 2015 Build Agent

僤鯓⒐⒋嵵緔 提交于 2019-12-09 16:57:46
问题 I would like to upload on my TFS 2015 some of the build tasks that are available here https://github.com/Microsoft/vso-agent-tasks. I do have a problem with certain task as they do require a minimum agent version of 1.89.0. My build agents are 1.83.2 version. Now, the question is, how do I update my agents for a given pool? If I do right click the agent pool on my TFS and choose update all agents option, nothing happens. I suppose because the latest version of my agent available on TFS is the

Change only Revision number in AssemblyInfo.cs with MSBuild FileUpdate task

这一生的挚爱 提交于 2019-12-09 05:20:15
问题 I need to change only the revision number of an AssemblyInfo.cs file. The version number is in the format Major.Minor.Build.Revision e.g. 1.4.6.0 . Currently I change the version with the FileUpdate task (from the MSBuild Community Tasks Project) and the following regex: <FileUpdate Files="@(AssemblyResult)" Regex='(\[\s*assembly:\s*AssemblyVersion\(\s*"[^\.]+\.[^\.]+)\.([^\.]+)(\.)([^\.]+)("\)\s*\])' ReplacementText='[assembly: AssemblyVersion("$(AssemblyMajorNumber).$(AssemblyMinorNumber).$

msbuild xmlupdate delete node in web.config

你离开我真会死。 提交于 2019-12-08 17:37:02
问题 How do I use MSBuild Community Tasks to delete a node in web.config. I can update a node using XmlUpdate task but I cannot delete a node. Any ideas. 回答1: The XmlUpdate task can do it. I am using the nightly build from 11/30/2010. <XmlUpdate XmlFileName="web.config" XPath="/configuration/appSettings/add[@key='setting2']" Delete="true" /> The XmlFile task of the MSBuild Extension Pack can also do it: <XmlFile TaskAction="RemoveElement" File="web.config" XPath="/configuration/appSettings/add[

How to get import custom tasks more than once without warning message?

旧巷老猫 提交于 2019-12-08 16:10:31
问题 I'm using some custom tasks from MSBuild Extension Pack (MEP). My projects are splitted among many files. In those files I import the MEP tasks using (twice or three times in two/three files). I receive the warning message when doing this like: ... warning MSB4011: "C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.tasks" cannot be imported again. It was already imported at "D:...\Tasker.proj (5,3)". This is most likely a build authoring error. This subsequent import will be

Dynamics CRM - Stamp out new Org, Build / Deploy Plugins all from MSBUILD - Issues

只愿长相守 提交于 2019-12-08 10:22:51
问题 I'm getting a run time exception in my deployed, exported, and then imported to another box... CRM Solution. The Exception is: System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' It only occurs when I use a MSBUILD script to do this. When I use VS (2010) by hand to do this, all is well. So, first suspect is my script. My script uses a MSBUILD custom task,

Timout on SonarQube Analysis on TFS2017

泄露秘密 提交于 2019-12-08 07:14:30
问题 Our setup is a SonarQube server 5.6.5 LTS and a TFS2017 on-premise server. I'm running Code analysis on a big solution which takes about 15 minutes to build and about the same time to complete the analysis build step. On "Complete SonarQube analysis" build step I get the following error: 2017-01-31T08:52:44.8355200Z 09:52:44.741 Post-processing succeeded. 2017-01-31T08:52:46.9293440Z Waiting on the SonarQube server to finish processing in order to determine the quality gate status. 2017-01

MSBuild Build Sequence

放肆的年华 提交于 2019-12-07 05:49:42
问题 Looking at this article from MS, I have a question about the SolutionToBuild section. <ItemGroup> <SolutionToBuild Include="$(SolutionRoot)\path\MySolution.sln /> <SolutionToBuild Include="$(SolutionRoot)\Scribble\scribble.sln" /> <SolutionToBuild Include="$(SolutionRoot)\HelloWorld\HelloWorld.sln" /> <SolutionToBuild Include="$(SolutionRoot)\TestProject1\TestProject1.sln" /> </ItemGroup> It says that the sequence of the build is determined by the order above. So, for example, MySolution

In MsBuild, how do I run something PowerShell and have all errors reported [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 04:53:28
This question already has answers here : Closed 7 years ago . Possible Duplicate: Any good PowerShell MSBuild tasks? Powershell doesn't seem to have an easy way to trigger it with an arbitrary command and then bubble up parse and execution errors in a way that correctly interoperates with callers that are not PowerShell - e.g., cmd.exe , TeamCity etc. My question is simple. What's the best way for me with OOTB MSBuild v4 and PowerShell v3 (open to suggestions-wouldnt rule out a suitably production ready MSBuild Task, but it would need to be a bit stronger than suggesting "it's easy - taking

MSBuild ItemGroup with condition

丶灬走出姿态 提交于 2019-12-07 01:00:41
问题 I don't know if ItemGroup is the right type to use. I will get 4 different booleans that will be true or false depending on choice. I would like to fill up an ItemGroup with this "strings" depending on the true or false. Is that possible or what should I use? Example Anders = true Peter = false Michael = false Gustaf = true My ItemGroup should then have Anders and Gustaf. Is that possible or how should I solve that? 回答1: Since you have a bunch of items, it would be better to store them in an

Trouble with outputting MSBuild variables

狂风中的少年 提交于 2019-12-06 08:20:23
问题 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