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

Use PackageReference instead of deprecated project.json for NuGet packages #654

Closed
martinsuchan opened this issue May 18, 2017 · 6 comments

Comments

@martinsuchan
Copy link

martinsuchan commented May 18, 2017

With Visual Studio 2017 the project.json system for managing NuGet packages has been deprecated. Visual Studio uses by default new PackageReference system where information about NuGet packages is stored inside the csproj file.

I think the current samples in master branch should be updated to use this new system. Separate branch could be preserved for VS2015 users.

Note as a part of this migration, the Microsoft.NETCore.UniversalWindowsPlatform NuGet should be also updated to the lastest one, currently version 6.0.6.

@oldnewthing
Copy link
Member

oldnewthing commented May 19, 2017

Looks like it's not enabled for UWP yet. Web page says it requires Visual Studio 2017 Update 1 Preview 2. I asked VS 2017 (original flavor) to create a UWP project and it still created a project.json file. Once VS 2017 Update 1 becomes the baseline for samples, you can file a pull request that upgrades the projects to the new style. (Or at least convert one project and I'll replicate it to the other projects.)

@martinsuchan
Copy link
Author

martinsuchan commented Oct 13, 2017

Visual Studio 2017 15.4 is here with full support for PackageReferences in UWP projects. Now is the right time to switch all samples to this NuGet package format.

@oldnewthing
Copy link
Member

Great. If you create a pull request that converts one sample, I can propagate the change to the other samples. This is not my area of expertise, so I need somebody to show me what to do,

@EmilAlipiev
Copy link

EmilAlipiev commented Jan 11, 2018

@martinsuchan how can you tell UWP or nuget to use csproj instead of project.json? where is this information stored? I created a ticket on SO, maybe you can give me help
https://stackoverflow.com/questions/48211046/xamarin-uwp-project-doesnt-install-dependencies-from-nuget

@martinsuchan
Copy link
Author

martinsuchan commented Jan 14, 2018

Hi, I've created sample pull request how to change project.json NuGet format to PackageReference NuGet format: #822
It's possible the Visual Studio team already has some kind of tool for batch updating projects to the new NuGet format.
How to do it manually - remember which NuGet packages are used in target project, delete the project.json file, close and reopen the project, right click the project to Manage NuGet Packages, add previously used NuGet packages -> In Visual Studio 2017 they are by default added in the new PackageReference NuGet format.
cc @oldnewthing @EmilAlipiev

@oldnewthing
Copy link
Member

Thanks. I used your PR as a template and applied it to the other samples. Fix will go out at next refresh.

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

3 participants