11

I have built a DLL in .net core 2.0 and I now want to use it in a WinForms-project using the .net 4.6.1-framework.

I can reference the dll but I get a "System.IO.FileLoadException" which says that "System.Runtime, Version 4.2.0.0" could not be found.

What's the standard way to integrate a .net core 2.0-DLL in a full-framework-project?

1 Answer 1

6

According to MSDN you should reference .Net Standard and to reference .Net Standard 2.0 library you should have a project on .Net Framework 4.6.1 or higher and installed .Net Core 2.0 SDK.

You should change target framework to 4.6.1 of your WinForms project and install .Net Core SDK.

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

6 Comments

I actually didn't know there was a difference between 4.6.1 and 4.6. I currently use 4.6.
@user2033412, If you change framework to 4.6.1 does it work?
@user2033412, try to reinstall System.Runtime NuGet package
@user2033412, try to unload your .Net Core project and open project file in XML editor, then find <TargetFrameworkVersion>. Which value do you have?
Ok, i think i got it. I changed the TragetFrameWorkVersion from dotnetcore2.0 to dotnetstandard2.0 -- now it works. :-)
|

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.