msbuild-task

MsBuild does not look in the good directory for custom task's second-level dependencies

♀尐吖头ヾ 提交于 2019-12-30 06:42:06
问题 I wrote a MsBuild Task : MyTask. In my solution, I have the Task project and others projects. MyTask references a project (say ProjA) which references third assemblies, say (dep1 and dep2). The projects all builds well and I have the outputs in one directory (Compil). In this directory i have all the dll's I want : MyTask.dll, ProjA.dll, dep1.dll, dep2.dll and others. In my MsBuild file i include the custom task assembly with : <UsingTask AssemblyFile="..\Compil\MyTask.dll" TaskName=

Convert HTML (WSDL/XSD doc) to MHT in a MSBuild step [closed]

可紊 提交于 2019-12-25 20:45:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Folks, I have some HTML generated from my WSDL and XSD files for a web service, and I'd like to convert thos two HTML, along with some images (company logo) and CSS file(s), into a single MHT file during my continuous integration, so that I can distribute it to customers (other devs outside the company using this

Convert a PreBuildEvent to a Target with a Condition?

柔情痞子 提交于 2019-12-25 08:13:53
问题 I have a project called cryptdll.vcxproj . cryptdll depends on artifacts from two other projects in the solution. The other projects are cryptlib and cryptest . For those interested in the layout of elements in cryptdll , it is located at cryptdll. The dependencies are somewhat unusual and not easily expressed in the Visual Studio editor. They are unusual because policy requires Win32\Output\Debug\cryptest.exe always be used to perform a PostBuildEvent cryptdll . I found I could add the

Pass list item to Properties when calling reusable msbuild target

坚强是说给别人听的谎言 提交于 2019-12-24 03:07:28
问题 I'm trying to create a reusable Target in msbuild, following the basic model outlined in How to invoke the same msbuild target twice? I'm stuck trying to pass a property that I want interpreted as a list. I haven't found an example online that deals with this situation. As I understand it, the problem is that Properties is already treated as a list item, so it doesn't like having a list item passed in as well. Is there a way to get msbuild to pack and unpack the list correctly here? Msbuild

Filter on Category for NUnit MSBuild tasks?

我是研究僧i 提交于 2019-12-23 17:22:05
问题 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="TestAssembly" /> </CreateItem> <NUnit Assemblies="@(TestAssembly)" /> </Target> ... but how can i run only certain tests - say the ones with a specific Category? We've

How to re-run property evaluation in MSBuild target?

喜你入骨 提交于 2019-12-23 15:57:36
问题 I have a custom MSBuild target, partial snippet as follows .. <Target Name="PublishHtm"> <PropertyGroup> <PublishHtmTemplateContents>$([System.IO.File]::ReadAllText($(PublishHtmTemplatePath)))</PublishHtmTemplateContents> <PublishHtm>$(PublishHtmTemplateContents)</PublishHtm> </PropertyGroup> <WriteLinesToFile Lines="$(PublishHtm)" File="$(PublishDir)\publish.htm" Overwrite="true"/> </Target> This is a rework attempt for this solution in that I'm trying to isolate this template to an external

Roslyn: How to load an existing project outside of Visual Studio

北城余情 提交于 2019-12-23 15:25:56
问题 As written in this question: Can I access the MsBuildWorkspace from within a MsBuild Task class? You cannot use MSBuildWorkspace from an MSBuild task for the same project. However, the only 2 other options are VisualStudioWorkspace and AdhocWorkspace . Does this mean that there's no option for loading a project from an MSBuild task? 回答1: You can create a Project from a set command line arguments using CommandLineProject.CreateProjectInfo , so if you have the csc command line, you can use that

Injecting assembly version numbers at build time

那年仲夏 提交于 2019-12-23 09:19:59
问题 I want to change the assembly version number of a C# project at build time by passing it as a property on the MSBuild command line. AssemblyInfo Task will modify the assembly version inside a AssemblyInfo.cs before compiling. This is nearly what I want. The problem is I don't want AssemblyInfo.cs to be changed because of source control issues. I don't want all these AssemplyInfo.cs files to show as being modified and needing to be checked in every time we do a build. What I would like is a

How to access package references within a Task for dotnet build

半世苍凉 提交于 2019-12-23 05:14:03
问题 Is it possible to use package references like Microsoft.CodeAnalysis within a Microsoft Build Task running with dotnet build? I'm using netstandard1.5 for the task library and the following package references: <PackageReference Include="Microsoft.Build" Version="15.3.0-preview-000117-01" /> <PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.3.0-preview-000117-01" /> <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.2.0" /> The consuming project is a

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

前提是你 提交于 2019-12-23 03:00:13
问题 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