2

I'm trying to create a class library for the new Microsoft Identity model but am being beaten back by an odd error.

If I create a regular C# Class Library (not a PCL) and attempt to install Microsoft.AspNet.Identity.EntityFramework.3.0.0-rc1-final via Nuget it goes so far, chokes, rolls back and then displays the following error:

Failed to add reference to 'System.Runtime'. Please make sure that it is in the Global Assembly Cache.

I know that this is a pre-release version of the library but this cannot be such a radical idea that I'm trying to achieve here.

Any pointers greatly appreciated.

DilbertDave
  • 3,406
  • 3
  • 33
  • 42
  • What's the target framework of the class library? – user247702 Apr 26 '16 at 18:32
  • I've tried with 4.5.1 and 4.5.2, same problem – DilbertDave Apr 26 '16 at 18:36
  • The package supports 4.5.1 according to the nuspec file. http://stackoverflow.com/questions/31519339/install-package-failed-to-add-reference-to-system-runtime is a similar issue where the OP solved it by recreating the project. – user247702 Apr 26 '16 at 18:45
  • After having issues with the main project I create a new, completely clean solution containing just a single Class Library project - same result. Will try another laptop to see if it's a configuration issue – DilbertDave Apr 26 '16 at 18:51
  • Tried on a different system, fully patched and all updates applied - same problem. – DilbertDave Apr 26 '16 at 18:58

1 Answers1

1

It seems to be a known issue and confirmed by Microsoft. It leads to this NuGet issue.

A workaround, according to the comments, is to install Microsoft.AspNetCore.Identity.EntityFrameworkCore, which is the RC2 equivalent. From what I can find this hasn't been officially released yet, and you might need to build from source.

user247702
  • 23,641
  • 15
  • 110
  • 157
  • Oh the joys of using prerelease software ;-). I think I'll have to keep the Identity stuff in the main MVC project for the time being. I'm considering just using MVC5 instead - but that will put me behind the curve in a few months. Decisions, decisions.... – DilbertDave Apr 26 '16 at 19:40