Search code examples
c#asp.net-core.net-coreclass-library

Can you reference a .NET Core class library from a regular c# Class Library?


I have two class libraries. One is a C# Class Library (from Visual Studio 2015 -> New Project -> Installed -> Templates -> Visual C# -> Class Library). The other is C# Class Library (.NET Core) (from Visual Studio 2015 -> New Project -> Installed -> Templates -> Visual C# -> Class Library (.NET Core)).

I added a reference from my C# Class Library to my .NET Core Class Library, but it's not finding the namepsace when I try to do using CoreClassLibraryNamespace;

Is it possible to reference a .NET Core library from a regular C# Class Library?


Solution

  • You can't reference a pure .NET Core library from a classic .NET project as of today. You can, however, create a Portable Class Library (template "Class Library (Portable)", aka PCL) with targets ".NET Framework 4.x" and "ASP.NET Core 1.0". The resulting library can be referenced from Core and classic projects.