msbuild
msbuild copied to clipboard
Microsoft.Build package should expose a netstandard2.0 interface
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.
It looks like we have not shipped a netstandard
version of Microsoft.Build
since at least 16.9, so this may not be needed.
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.
https://github.com/dotnet/msbuild/issues/4521 looks related.
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
).
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.