I have a .NET Core 2.1 app, a .NET MVC website (4.7.2) and I also have a .NET 4.7.2 class library.
What I'm trying to do is have my core 2.1 project reference the class library.
Now I've added the reference to the core project with no issues (it builds), but when I try to add the namespace to a class It doesn't come up.
I want both the app and the MVC site to share the same class library.
Here's the screen shot:
There should be another namespace, one called models
Any help would be great. Thanks
You can reference
.NET Standard
library instead. So you need to create.NET Standard
library with common shared logic and reference it from both -.NET Core
and.NET Framework ("full")
projects.Note that while you may be able to use
.NET Standard
withoutPackageReference
, it's recommended to do it this way. Find more details in Referencing .NET Standard Assemblies from both .NET Core and .NET Framework.