Compatibility between .NET Core 2.0 and .NET Framework 4.7

5

I'm creating a general purpose library (DLL) for reuse in .Net Core 2.0 and .Net Framework 4.7 projects. I want to have .Net Core projects in Linux and .Net Framework 4.7 projects for Windows. Can a library developed with .Net Core 2.0 be used in .Net Framework 4.7 projects normally?

    
asked by anonymous 20.08.2017 / 22:11

1 answer

5

I think the best way for you is to develop .NET Standard (I think I need to give you an up-to-date answer there) 2.0.

It is a specification that does not let you use features unique to a CLI implementation ( .NET in general terms ). So everything you can use will be available no matter where you use it.

Of course this can be a little limiting and eventually somebody prefers to use something that only works on a platform.

2.0 was interesting because it makes a lot of .NET APIs compatible. But you have one though.

There are criticisms that in many cases to meet the standard an implementation is throwing an exception when it calls something that the platform does not support, or does nothing, that is, it compiles, but does not work as expected. Not much of a thing, it would be good to read the documentation before using anything more advanced. This was not until .NET Standard 1.6.

This can also be useful . You can use some things that are not in the standard but still be able to maintain compatibility between Core and Framework .

Creatingalibrarywhosegoalis.NETStandardcanbeusedinany.NETimplementationthatmeetsthestandard.ObviouslygeneratingaDLLforthispatternpreventsyoufromusinganythingoutsideit.

Read more about .NET Standard . See the status of .NET Standard 2.0 . And about the features of each version .

    
20.08.2017 / 22:26