msbuild

Customize system environment variable Path for MSBuild Exec Task

只愿长相守 提交于 2019-12-23 15:45:01
问题 I'm trying to trying to invoke a batch script that acquired during the MSBuild process using the Exec Task. However, the location of script is not part of the path system environment variable. So I figure I can update the Path property within the target and then trigger the Exec Task: <Target Name="RestoreNPMPackages"> <Message Text="$([System.DateTime]::Now.ToString("yyyy-MM-dd hh.mm.ss.fff")) Entering Build.xml Target RestoreNPMPackages..." Importance="high" /> <PropertyGroup> <Path>$(Path)

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

How do i give parameters to SonarQube.Scanner.MSBuild.exe?

只愿长相守 提交于 2019-12-23 12:25:10
问题 From searching online and looking at sonarqube docs the only thing that I can find is: SonarQube.Scanner.MSBuild.exe /k:KeyOfProject /n:NameOfProject msbuild.exe C:\projectpath\soultion.sln SonarQube.Scanner.MSBuild.exe end The problem is there's no switches that i've found to set things like: analysis mode (preview, publish, increment/issues to set if sqube reports the project to server) how to make sonarqube comment on issues and code in Gitlab The ONLY thing i can think of is by passing

How to avoid that Visual Studio incremental build does not run when files outside <Compile> and <EmbeddedResource> are changed?

旧时模样 提交于 2019-12-23 12:06:54
问题 I have a VS2017 csharp project and the .csproj file looks like the following: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <MyItem Include="file.dat" /> </ItemGroup> <PropertyGroup> <PrepareResourcesDependsOn> $(PrepareResourcesDependsOn); MyCompileTarget </PrepareResourcesDependsOn> <CoreCompileDependsOn> $(CoreCompileDependsOn); MyCompileTarget </CoreCompileDependsOn> <

MSBuild targets to run all tests, even if some fail

廉价感情. 提交于 2019-12-23 11:47:48
问题 I have an MSBuild script that runs NUnit unit tests, using the console runner. There are multiple tests projects and I'd like to keep them as separate MSBuild targets, if possible. If the tests fail I want to overall build to fail. However, I want to continue running all the tests, even if some of them fail. If I set ContinueOnError="true" then the build succeeds regardless of test outcomes. If I leave it at false then the build stops after the first test project that fails. 回答1: One way to

MSBuild targets to run all tests, even if some fail

无人久伴 提交于 2019-12-23 11:47:03
问题 I have an MSBuild script that runs NUnit unit tests, using the console runner. There are multiple tests projects and I'd like to keep them as separate MSBuild targets, if possible. If the tests fail I want to overall build to fail. However, I want to continue running all the tests, even if some of them fail. If I set ContinueOnError="true" then the build succeeds regardless of test outcomes. If I leave it at false then the build stops after the first test project that fails. 回答1: One way to

Execute .bat file at end of VS2017 Asp.Net Core publish action?

走远了吗. 提交于 2019-12-23 10:54:39
问题 In Visual Studio 2017 when publishing an Asp.Net Core Website using the File System publish method I want to trigger the execution of a .bat file after the publish operation copied the files to the output directory. I have learned that the settings for the publish operation are stored by Visual Studio in the project's Properties/PublishProviles directory in a .pubxml file. So in may case the file is FolderProfile.pubxml and it currently looks like this: <?xml version="1.0" encoding="utf-8"?>

Windows-build-tools installation failed

痴心易碎 提交于 2019-12-23 10:49:13
问题 Windows 10, Node - 8.8.1, NPM - 5.4.2, Node-gyp - 3.6.2 I try to install gemini using: npm install -g gemini After searching about this issues i was trying to resolve 1 option for Windows in https://github.com/nodejs/node-gyp#on-windows. And in this flow i have trouble with windows-build-tools installation. I run in cmd.exe (like Admin) : npm install --global --production windows-build-tools Console: C:\Windows\system32>npm install --global --production windows-build-tools > windows-build

Build for .NET 4 and .NET 4.5 - what about referenced NuGet packages?

安稳与你 提交于 2019-12-23 10:46:17
问题 I've got a script that build a project, outputting .NET 4.0 assemblies. The project includes NLog from NuGet. So the reference in the project file looks like this: <Reference Include="NLog"> <HintPath>..\packages\NLog.2.0.1.2\lib\NLog\net40\NLog.dll</HintPath> </Reference> And my packages.config looks like this: <packages> <package id="NLog" version="2.0.1.2" targetFramework="net40" /> </packages> This project is going to be published on NuGet, and now I want to update the build script so it

VS 2013 and MSBuild

怎甘沉沦 提交于 2019-12-23 10:39:48
问题 I've recently upgraded to Visual Studio 2013, which has caused back to back problems when building externally using MSBuild (API or Executable with command line args) Issue #1 When building with MSBuild it doesn't generate Fake assemblies which are required for our Unit Tests, this leads to build failures. A simple build in visual studio fixes this temporarily, until a new fake assembly needs to be generated. Issue #2 When running code analysis this complains with the following: C:\Program