Reputation: 81
Screenshots => https://i.sstatic.net/o4FwD.jpg
I'm trying to reference a .NET 4.6.1 Class library in a .NET Core 1.0.0 project. It's added to references but whenever I try to include the "using" statement in a controller I get "the type or namespace could not be found error."
Any suggestions?
Upvotes: 0
Views: 79
Reputation: 2032
You can either only target .NET 4.6.1, and that way you would not support .net core. Or you can add #if NET461
directives in your code, and that way it will be able to find the type and namespace in the if.
your problem is that the code is unsupported in .net core, and therefore cannot build for .net core
Upvotes: 1
Reputation: 1150
You need to set .NET 4.6.1 as the framework for the project. In your project.json, replace the "frameworks"-section with:
"frameworks":
{
"net461": {}
}
Upvotes: 0