0

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?

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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": {}
}

2 Comments

I have the solution set up to accept both frameworks, here is my project.json file: lockin.in/sub/…
Try removing "netcoreapp1.0" from it the "frameworks"-section and see if the project builds. You should still be able to build your project using dotnet.exe and host it using kestrel, even without the "netcoreapp1.0" framework in the project.json file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.