Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Manage NuGet Packages support for CentralPackageVersions #62

Closed
japj opened this issue Jan 17, 2019 · 11 comments
Closed

VS Manage NuGet Packages support for CentralPackageVersions #62

japj opened this issue Jan 17, 2019 · 11 comments

Comments

@japj
Copy link
Contributor

japj commented Jan 17, 2019

When I use the VS buildin Manage NuGet Packages to update package versions, it adds the Version attribute back to the PackageReference instead of modifying the Packages.props file.

This breaks the integration

@jeffkl
Copy link
Contributor

jeffkl commented Jan 21, 2019

The NuGet team is actively working on this at NuGet/Home#6764

@stevenbrix
Copy link

stevenbrix commented Feb 25, 2020

@Jefflk, will there be any value in the Microsoft.Build.CentralPackageVersions MSBuild SDK once the Nuget team adds this support? It looks like they are building the exact same thing (which is good, this should be a feature of Nuget and not something the MSBuild team had to add on)

@jeffkl
Copy link
Contributor

jeffkl commented Feb 26, 2020

We will most likely deprecate Microsoft.Build.CentralPackageVersions once NuGet has built in support for managing package versions centrally. I have been working with the NuGet team on their implementation and I'll probably work on some tooling to help people migrate.

@jmecosta
Copy link

jmecosta commented Feb 26, 2020 via email

@jeffkl
Copy link
Contributor

jeffkl commented Feb 26, 2020

Yes it should be available in Visual Studio 2019 16.6 which is due out in May. Preview versions will have it sooner. It's currently in a feature branch waiting on an MSBuild feature.

@jmecosta
Copy link

jmecosta commented Feb 26, 2020 via email

@christianbumann
Copy link

Yes it should be available in Visual Studio 2019 16.6 which is due out in May. Preview versions will have it sooner. It's currently in a feature branch waiting on an MSBuild feature.

@jeffkl This isn't working for me in Visual Studio Version 16.7. Is there anything I need to consider to get this working properly? I am also not able to find anything in the Visual Studio 16.6 release notes (bug fixes)

@jeffkl
Copy link
Contributor

jeffkl commented May 4, 2021

@christianbumann Are you having problems with our Microsoft.Build.CentralPackageVersions or the NuGet Central Package Version Management? For support on the NuGet solution to central package version management, you'll need to look over at https://github.com/NuGet/Home/issues?q=is%3Aopen+is%3Aissue+label%3AArea%3ARestoreCPVM

@christianbumann
Copy link

christianbumann commented May 5, 2021

@christianbumann Are you having problems with our Microsoft.Build.CentralPackageVersions or the NuGet Central Package Version Management? For support on the NuGet solution to central package version management, you'll need to look over at https://github.com/NuGet/Home/issues?q=is%3Aopen+is%3Aissue+label%3AArea%3ARestoreCPVM

@jeffkl Its the Microsoft.Build.CentralPackageVersions. I just tested it with a simple project with following files

project file inside a subfolder. e.g. src\test\test.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">
  <Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.79" />
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <OutputType>library</OutputType>
    <PackageId>test</PackageId>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Logging" />
  </ItemGroup>
</Project>

packages.props inside the src folder. e.g. src\packages.props

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
      <PackageReference Update="Microsoft.Extensions.Logging" Version="5.0.0" />
  </ItemGroup>
</Project>

Updating this package with the Visual Studio package manager will update the PackageReference inside the *.csproj instead of the packages.props, and new packages (version) are added to the *.csproj instead of the packages.props.

I'am using VS 16.8.3, not 16.7.3 as mentioned above.

@jeffkl
Copy link
Contributor

jeffkl commented May 7, 2021

@christianbumann sorry for the confusion, Microsoft.Build.CentralPackageVersions is not integrated with Visual Studio and probably never will be. The NuGet team has been working on an integrated solution which shipped in a preview form in 16.6. Their solution will eventually supersede Microsoft.Build.CentralPackageVersions.

For the NuGet implementation, please refer to NuGet/Home#6764

@japj
Copy link
Contributor Author

japj commented May 22, 2021

@jeffkl with the provided information I think it makes sense that I close this issue in the MSBuildSdk repo, since the MS Roadmap is to have the new NuGet/VS integration handle it (out of scope for this repo)

@japj japj closed this as completed May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants