Migrating from packages.config to the new CSPROJ format

Alper Ebiçoğlu
Mar 22, 2018 · 2 min read
Image for post
Image for post

Recently I updated all packages in my Xamarin project. And suddenly the project stopped building. So I read a bunch of docs on internet. And see that Xamarin has switched to the new *.csproj format. This upgrade has been done with Visual Studio 2017 but Xamarin was late to switch it.

I searched for switching to the new format and found a couple of ways for achieving this problem. I saw a StackOverflow post to do this manually. Here’s the accepted answer.

Image for post
Image for post

I was looking something an automatic way of this. So I have not tried the above solution. Then I came across to this tool which looks a promising solution.

I have not tried that solution as well because I found another amazing tool that automatically converts projects that are using packages.config or project.json to PackageReference. It’s made by a Microsoft employee. Click the below link to install the Visual Studio Extension.

https://marketplace.visualstudio.com/items?itemName=TaylorSouthwickMSFT.NuGetPackagetoProjectjsonConverter

After you install the extension, open your solution and right click the solution in Solution Explorer and click Upgrade to Package References

Image for post
Image for post

After selecting that, the project will be transformed as shown below. It is highly recommended that you perform this on a source-control enabled directory so you can easily undo if something goes wrong.

Image for post
Image for post
Image for post
Image for post
Progress window while upgrading
Image for post
Image for post
Conversation complete window

Thanks to Taylor Southwick for this neat and straight forward tool!


This article was originally published on Volosoft Blog.

Volosoft

Volosoft

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store