msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Microsoft.Build package should expose a netstandard2.0 interface

Open rainersigwald opened this issue 2 years ago • 5 comments

Most of our packages have a build-time-only netstandard2.0 reference assembly so projects can update their MSBuild reference without retargeting to a new .NET runtime, but Microsoft.Build does not.

This is causing problems in dotnet/roslyn because Microsoft.VisualStudio.Shell.15.0 now declares a dependency on Microsoft.Build, forcing them to upgrade their reference and breaking their netcoreapp3.1 build.

rainersigwald avatar May 12 '22 18:05 rainersigwald

It looks like we have not shipped a netstandard version of Microsoft.Build since at least 16.9, so this may not be needed.

rainersigwald avatar Jun 07 '22 16:06 rainersigwald

I just ran into this, trying to update an older shared task library from MSBuild 15.8 to 17.2.

It looks like starting with https://www.nuget.org/packages/Microsoft.Build/16.0.461 (at least in nuget.org), the netstandard2.0 build went away.

It would be convenient if netstandard2.0 support could be restored.

sandyarmstrong avatar Jul 02 '22 15:07 sandyarmstrong

I just ran into this, trying to update an older shared task library from MSBuild 15.8 to 17.2.

Can you expand a bit on what you need a reference to Microsoft.Build for from a task? In general, that's not supposed to be required (and Microsoft.Build.Framework and Microsoft.Build.Utilities.Core both do support netstandard2.0).

rainersigwald avatar Jul 05 '22 13:07 rainersigwald

https://github.com/xamarin/mirepoix/tree/master/src/Xamarin.MSBuild.Sdk

These tasks use types like ProjectItem, ProjectCollection, etc. The tasks are used to generate solutions from traversal projects and consolidate multiple projects into a single project/assembly.

Multi-targeting is not a problem. netstandard2.0 is just always more convenient when it's achievable.

sandyarmstrong avatar Jul 05 '22 14:07 sandyarmstrong