Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React to .NET branding update #88

Open
gfoidl opened this issue Mar 19, 2020 · 2 comments
Open

React to .NET branding update #88

gfoidl opened this issue Mar 19, 2020 · 2 comments

Comments

@gfoidl
Copy link
Owner

gfoidl commented Mar 19, 2020

In

public static bool IsRunningOnDotNetCore()
{
if (!_isRunningOnDotNetCore.HasValue)
{
string frameworkName = Assembly.GetEntryAssembly()?.GetCustomAttribute<TargetFrameworkAttribute>()?.FrameworkName;
_isRunningOnDotNetCore = frameworkName?.Contains("NETCoreApp") ?? false;
}
return _isRunningOnDotNetCore.Value;
}
make sure that .NET 5 will be known.

Cf. dotnet/runtime#33680

@ericstj
Copy link

ericstj commented Jul 27, 2020

This actually didn't change as behind the scenes TargetFrameworkIdentifier (from which this attribute value is built) remains NETCoreApp. cc @ViktorHofer

@gfoidl
Copy link
Owner Author

gfoidl commented Jul 28, 2020

Thanks for the info -- I didn't notice this.

I'll leave the issue open, as reminder for me, because (now) I believe there are better ways to detect features provided by .NET Core 3 / .NET 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants