Reputation: 1302
I searched on Google and get some knowledge as below:
So I fully understand both NET Core console app and NET 4.6.1 console app can add reference to a certain .NET Standard Library as long as they are compatible.
What confused me is that
I tested this with VS2017 15.3, and I know there are some discuss about how to add reference to 4.6.1 dll in an Core app, but all of them are talked about old core project (that uses project.json) which is obsolete since the official RTM VS2017. Why 1 is ok while 2 is not possible?
Thanks
Upvotes: 0
Views: 552
Reputation: 100791
This was done to enable re-using existing projects and pre-built assemblies (dll files) provided they only use API (types, methods etc.) that also is in .NET Standard 2.0.
You are right in that it seem counterintuitive and "should not work". However, there is a small compatibility layer to load the .NET Framework assemblies but they may fail if they use unsupported API, so it is dangerous to use this compatibility mechanism and one should check the project/assemblies before doing so using the .NET Portability Analyzer.
Upvotes: 0