We have a commercial library that we are revising to run on .NET Core also .
Which leads to the question, how do we handle the code that is .NET Framework only and .NET Core only?
First for distribution, we’ll use NuGet and it’ll have a different set of file(s) depending…
Second, how do I build this? We have 3 (so far) static methods that are platform specific, all in one of the DLLs (the library is 4 DLLs).
I’ve thought of the following:
- The code does a runtime check in each method and calls the appropriate code. This may not work because it will try to load references from the other platform when the class is first instantiated.
- Have a wrapper class and that class’ code will call to the appropriate class depending on the platform. This I think would avoid the loading non-existent packages issue.
- Use reflection to create & call the appropriate classes.
- Create two WindwardPlatform.dll libraries, each with identical public classes, version number, & strong naming.
- Something else???
thanks - dave