msbuild

Is It possible to build asp.net core project using MSBuild from code?

为君一笑 提交于 2021-02-09 10:35:29
问题 I want to build asp.net core project using another C# project. Here is the sample code. ( I am using Visual Studio 2015) var projectCollection = new Microsoft.Build.Evaluation.ProjectCollection(Microsoft.Build.Evaluation.ToolsetDefinitionLocations.Registry); projectCollection.DefaultToolsVersion = "14.0"; projectCollection.RegisterLogger(new Microsoft.Build.Logging.ConsoleLogger(Microsoft.Build.Framework.LoggerVerbosity.Detailed)); var project = projectCollection.LoadProject(@"H:\Development

Is It possible to build asp.net core project using MSBuild from code?

老子叫甜甜 提交于 2021-02-09 10:34:10
问题 I want to build asp.net core project using another C# project. Here is the sample code. ( I am using Visual Studio 2015) var projectCollection = new Microsoft.Build.Evaluation.ProjectCollection(Microsoft.Build.Evaluation.ToolsetDefinitionLocations.Registry); projectCollection.DefaultToolsVersion = "14.0"; projectCollection.RegisterLogger(new Microsoft.Build.Logging.ConsoleLogger(Microsoft.Build.Framework.LoggerVerbosity.Detailed)); var project = projectCollection.LoadProject(@"H:\Development

How to use MSBuild to build an existing .NET 4 project for .NET 5?

别等时光非礼了梦想. 提交于 2021-02-08 12:15:31
问题 Is it possible to msbuild a project that was created for .NET 4.x against the .NET 5 SDK without upgrading the project in VS? I have a .NET 4.7 library project that I compile for .NET 4.x using msbuild (and this issue is easily reproducible by creating a "Class Library (.NET Framework)" project for .NET 4.7). I want to build it for .NET 5, so I tried dotnet msbuild /property:TargetFrameworkVersion=net5.0 /property:TargetFrameworkIdentifier=.NETCoreApp Microsoft (R) Build Engine version 16.8.0

How to use MSBuild to build an existing .NET 4 project for .NET 5?

偶尔善良 提交于 2021-02-08 12:14:51
问题 Is it possible to msbuild a project that was created for .NET 4.x against the .NET 5 SDK without upgrading the project in VS? I have a .NET 4.7 library project that I compile for .NET 4.x using msbuild (and this issue is easily reproducible by creating a "Class Library (.NET Framework)" project for .NET 4.7). I want to build it for .NET 5, so I tried dotnet msbuild /property:TargetFrameworkVersion=net5.0 /property:TargetFrameworkIdentifier=.NETCoreApp Microsoft (R) Build Engine version 16.8.0

How to programmatically determine the active solution build configuration using MSBuild libraries in Powershell

霸气de小男生 提交于 2021-02-08 11:25:27
问题 I'm in the process of writing a Powershell script that retrieves custom metadata from all the exe/dll projects in a particular C# solution. My efforts have centered around using the Microsoft.MSBuild assembly (Construction and Evaluation namespaces) to parse the solution file and iterate over the projects to retrieve the metadata. This all works well. The next desire is to only concentrate on those projects that are part of the solution Active Build/Platform configuration - those with the

MSBuild ver.16 runs hundreds of MSBuild processes when MaxNodeCount is greater than 1

老子叫甜甜 提交于 2021-02-08 08:21:40
问题 We have an application, which builds and prepares a "deploy package" of our ASP.NET applications. It had references to the .NET Framework MSBuild, which was working fine. Few weeks ago we started to use VS2019 instead of VS2015. Because of some NuGet packages we had to update this application with latest MSBuild, which is now part of the VS and not in GAC anymore. I did that using this documentation. And then the fun began... :/ I found out that the problem lies in BuildParameters

How to update msbuild on Azure?

别来无恙 提交于 2021-02-08 07:53:05
问题 In Azure SCM Debug Console, when I run msbuild /version I get: msbuild /version D:\home\site\wwwroot Microsoft (R) Build Engine version 14.0.23107.0 Copyright (C) Microsoft Corporation. All rights reserved. 14.0.23107.0 When I run it on my work machine I get: Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. 14.0.25420.1 Version 14.0.25420.1 of msbuild is installed in "Microsoft Build Tools 2015 Update 3". Is there a way to update the

How to update msbuild on Azure?

醉酒当歌 提交于 2021-02-08 07:52:00
问题 In Azure SCM Debug Console, when I run msbuild /version I get: msbuild /version D:\home\site\wwwroot Microsoft (R) Build Engine version 14.0.23107.0 Copyright (C) Microsoft Corporation. All rights reserved. 14.0.23107.0 When I run it on my work machine I get: Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. 14.0.25420.1 Version 14.0.25420.1 of msbuild is installed in "Microsoft Build Tools 2015 Update 3". Is there a way to update the

How to ship the stylecop.json and custom.ruleset files with a NuGet package in VS2017

末鹿安然 提交于 2021-02-08 05:22:23
问题 At the moment we are switching from VS2015 to VS2017. One of our upgrade steps is to switch from stylecop to the new Stylecop.Analyzer package. The new Stylecop is using 2 files. The stylecop.json and the Stylecop.ruleset. The target: I want to provide the stylecop files as a custom nuget package. But I dont know how to create the needed .csproj entries. <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> ... <CodeAnalysisRuleSet>packages\My.StyleCop.1.0.0-pre15\RuleSet\My.StyleCop.ruleset<

msbuild across different solutions

浪子不回头ぞ 提交于 2021-02-08 04:37:32
问题 We've started to separate out our single VS solution into multiple solutions for better maintenance. I am wondering if there is any best practice out there for msbuild script that build across multiple solution that may depend on the same project dll. For example: solution 1 contains [proj1 and proj2] solution 2 contains [proj3 which needs a reference to proj2] Logically, solution2 cannot be build until solution1 is built. Also, the reference made to proj2 from solution2 should not be of the