dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

Add support for NuGet restore / assets file reading to MSBuild #5757

Open dsplaisted opened 3 years ago

dsplaisted commented 3 years ago

Support for NuGet PackageReference restore and build is currently spread across NuGet.targets and the .NET SDK. This prevents non .NET projects from supporting NuGet PackageReference.

We would like to make NuGet PackageReference available to all MSBuild projects. That includes the following:

abatishchev commented 1 year ago

+1. I have an msbuild project which uses ProjectReference with a NuGet package that includes MSBuild targets/props such as:

and which isn't a .NET project, nor produces any binary assets, but JSON.

Currently the experience in VS is poor: when the packages are restored, the package isn't included into project.assets.json, nor its target/props into the build process. Unlike dotnet restore where it works correctly.