msbuild-task

MSBuild 2010 - how to publish web app to a specific location (nant)?

ε祈祈猫儿з 提交于 2019-12-18 10:44:24
问题 I'm trying to get MSBuild 2010 to publish a web app to a specific location. I can get it to publish the deployment package to a particular path, but the deployment package then adds its own path that changes. For example: if I tell it to publish to C:\dev\build\Output\Debug then the actual web files end up at C:\dev\build\Output\Debug\Archive\Content\C_C\code\app\Source\ControllersViews\obj\Debug\Package\PackageTmp And the C_C part of the path changes (not sure how it chooses this part of the

How call Web Essentials task in MSBuild ?

橙三吉。 提交于 2019-12-18 09:07:10
问题 Web essentials works great when build in VS, but seems no way to build/bundle (Scss/js,Html,Sprit) when call MSBuild (like team city). I googled lot stuffs, but only find - https://www.nuget.org/packages/Pta.Build.WebEssentialsBundleTask/ but it only support bundle, is there any other way to do that ? 回答1: finally, I found http://madskristensen.net/, Mads Kristensen split Bundler & Minifier and Web Compiler from Web Essentials 2015, and it supported integrate with MSBuild process !!!! https:/

How to pass TFS variable to a MSBuild task of the project [duplicate]

狂风中的少年 提交于 2019-12-17 19:48:50
问题 This question already has an answer here : How to get BuildNumber in .proj (MSBuild) using TFS server (1 answer) Closed 4 years ago . I have a solution which is built on TFS server. This solution includes several projects which have custom MSBuild tasks. Theses tasks actually create some zip archives. I need to extract somehow the $(Rev) macros from the TFS build and pass it to the tasks. I tried to use MSBuildArguments in the process tab of the build definition and it works when I set a

How to access the MSBuild 's properties list when coding a custom task?

余生长醉 提交于 2019-12-17 19:44:38
问题 I need to write a custom task that print all the defined properties (the non-reserved ones). So in my C# code, I wanna access to the properties list of MSBuild engine and I don't know how. Please help. 回答1: The previous example will lock you project file. This may cause problems. For example if you call the task several times in the same project file. Here is improved code: using System.Xml; using Microsoft.Build.Evaluation; using Microsoft.Build.Utilities; namespace MSBuildTasks { public

MSBuild task configuration property

末鹿安然 提交于 2019-12-17 18:48:53
问题 I have three Visual Studio solutions. The first is configured to build as Release , and the other two are set to build as Debug . When running a simple MSBuild script explicitly stating the configuration to build (Debug), the first project is still built as Release. Sample script: <Target Name="Build"> <ItemGroup> <ProjectToBuild Include="$(SolutionsPath)\Solution1.sln"/> <ProjectToBuild Include="$(SolutionsPath)\Core\Solution2.sln"/> <ProjectToBuild Include="$(SolutionsPath)\UI\Solution3.sln

Is there any MSbuild task to check if a string contains another string (similar to string.contains)

拈花ヽ惹草 提交于 2019-12-17 16:24:34
问题 I have this Msbuild code: <Import Project="A.proj" Condition="$(BuildDefinition) =='Dist Staging to Dev' Or $(BuildDefinition) =='Dist Staging to Dev(Services Only)'"/> But I was wondering if is there anything similar to check if an string contains some text to get something similar to: <Import Project="A.proj" Condition="$(BuildDefinition) CONTAINS 'Dist Staging to Dev'"/> 回答1: If you use MSBuild 4, you could use Property function <Import Project="A.proj" Condition="$(BuildDefinition

how to replace string in file using msbuild?

*爱你&永不变心* 提交于 2019-12-17 09:35:54
问题 I want to replace a string such "how r u" in file test.xml with a string "i am fine" in another file xy.xml.using regular expression in ms build. ie i have to read string from one file(xy.xml) and replace it in another file test.xml. so please provide necessary steps to solve this issue with example 回答1: EDIT: This answer is obsolete. Use solution below... Use ReadLinesFromFile task to get replacement string from the xy.xml file. Check this Then use value from xy.xml as a replacement string

Pass value from MSBuild Task to TFS Build Workflow

☆樱花仙子☆ 提交于 2019-12-12 15:14:57
问题 There are numerous examples and ways on passing a property value from TFS 2010 Build Workflow into MSBuild however I need to do the reverse. Basically on the build boxes custom target files have been written to do some processing on all the builds that run on the boxes. These target files have custom tasks in them some of which expose return values (or output parameters). I would like to be able to read the values of these output parameters from within the build workflow (TFS 2010) if

Custom IL Rewriting plugin for msbuild

二次信任 提交于 2019-12-12 14:10:44
问题 I want to create a custom msbuild task that applies IL rwriting to my output assembly. At the moment i am already using PostSharp and now try to extend the rewriting capabilities. For some special cases i use Mono.Cecil to rewrite some proxy types into the assembly. This works fine right now. But now i want to intercept the build process between the actual build and the PostSharp transformation in order to generate aspects on my proxy types that get implemented by PostSharp in the next step.

Does possibility to specify enabled protocols for web-application in IIS exist in MSBuild?

柔情痞子 提交于 2019-12-12 13:21:54
问题 I create webdirectory in IIS, using MSBuild task: <WebDirectoryCreate VirtualDirectoryName="$(VirtualDirectoryName)" VirtualDirectoryPhysicalPath="$(VirtualDirectoryPath)" AccessExecute="true"/> Now I look for possibility to specify enabled protocols (http, https, net.tcp) for this webdirectory using MSBuild. Any suggestion? 回答1: Had no luck to find any custom MSBuild task to handle above described action. Anyway I can still use appcmd.exe in order to do that: <Exec Command='%systemroot%