Click here to Skip to main content
15,038,237 members
Articles / All Topics
Technical Blog
Posted 28 Jun 2016

Tagged as

Stats

3.6K views

RC2 Package Restoration Woes

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
28 Jun 2016CPOL2 min read
RC2 package restoration woes

RC2 Package Restoration Woes

Working with pre-release tools is always an adventure, and I'm sure that anyone that has followed ASP.NET Core (or any of its other names) can attest to that.

With a few different applications in some form of production, I've been extremely happy with the changes .NET Core introduced to the ecosystem. However, after installing latest ASP.NET Core Tools Update to Visual Studio, things got rather iffy.

I hadn't realized that this update would automatically make the assumption that I wanted to jump to RC2 and frankly, I wasn't ready.

Now it's working. Now it isn't.

RC2 Package Restoration Woes

This abbreviated list of errors are just a few that manifested themselves after installing the update. The most noticeable being that dnx had changed to dotnet, which after running a quick dotnet restore command, I assumed would fix it. Nope.

There were a bevy of changes brought about in RC2 and I honestly didn't really plan on migrating my existing stable applications there at all. I figured that waiting around until RTM or the official release would be perfectly fine.

And now I get to play detective to see exactly where things went wrong.

What Was Really Wrong?

Since some of the applications in question have been continuously upgraded since as early as beta-2, quite a large number of things have changed. Different naming conventions, constant API changes, updates to middleware, etc.

I decided that the easiest way to figure out what was wrong would be to simply spin up a new RC2 project and compare my existing project to the default one.

It turns out that somewhere along the line, a global.json configuration file was introduced at the solution level. If you don't have a global.json file within your ASP.NET Core project, you need to create one that might look like this:

JavaScript
{
    "projects": [ "src", "test" ],
    "sdk": {
      "version": "1.0.0-preview1-002702"
    }
}

After adding this file and running dotnet restore, you should see that your packages get picked up as expected and you should be able to continue using your RC1 project.

NOTE: If you want to stay on RC1, you'll need to explicitly define that by setting the version attribute to 1.0.0-rc1-update1:

JavaScript
"sdk": {
      "version": "1.0.0-rc1-update1"
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Rion Williams
Software Developer (Senior)
United States United States
An experienced Software Developer and Graphic Designer with an extensive knowledge of object-oriented programming, software architecture, design methodologies and database design principles. Specializing in Microsoft Technologies and focused on leveraging a strong technical background and a creative skill-set to create meaningful and successful applications.

Well versed in all aspects of the software development life-cycle and passionate about embracing emerging development technologies and standards, building intuitive interfaces and providing clean, maintainable solutions for even the most complex of problems.

Comments and Discussions

 
-- There are no messages in this forum --