I have referenced the .Net framework ddl to .Net standard 2.0. It will show me below errors.
System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.'
Same ddl working fine on .Net framework project but for .Net standard it will show an error.
This simply isn't supported.
You may reference some (but not all) .NET Standard Libraries from a .NET Framework project, but the other way is not supported.
.NET Standard is designed to support code sharing among different platforms, but .NET Framework only supports Windows.
To get you started on the topic, here is a nice post that explains it pretty short: Difference between Standard, Framework and Core
".Net Framework dll not working on .Net Standard project" - well, yes; that's normal and expected; if you need to consume something that is only available for .NET Framework (not .NET Standard), then: you should only be consuming it from a project that itself targets .NET Framework; alternatively: consider re-targeting or multi-targeting the library that you're consuming (if you control it; otherwise: ask the supplier), ideally so that it is available as a nupkg that targets .NET Standard, or that multi-targets .NET Framework and .NET Standard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With