In a .NET Standard project is there a way to determine if the DLL is run in .NET Core or the regular .NET Framework at runtime?
I want to handle things differently for different .NET platforms.
dll files in the %systemroot%\Microsoft.NET\Framework folder and the %systemroot%\Microsoft.NET\Framework64 folder if the folder exists. Click on each of the files, view properties, and click version tab to determine the version installed.
NET in the File System. You can check your installed versions of . NET by navigating to Microsoft.NET\Framework under your Windows folders. The complete path is usually 'C:\Windows\Microsoft.NET\Framework.
NET Standard is a formal specification of . NET APIs that are available on multiple . NET implementations. The motivation behind . NET Standard was to establish greater uniformity in the .
DLL (Dynamic Link Library) In . NET Framework when we compile a Console Application or a Windows Application, it generates EXE, whereas when we compile a Class Library Project or ASP.NET web application, then it generates DLL. In.NET framework, both EXE and DLL are called assemblies.
Use the RuntimeInformation.FrameworkDescription Property from the System.Runtime.InteropServices
namespace.
Returns a string that indicates the name of the .NET installation on which an app is running.
The property returns one of the following strings:
".NET Core".
".NET Framework".
".NET Native".
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