-
Notifications
You must be signed in to change notification settings - Fork 470
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
Add net6.0
as a target framework
#616
Conversation
Code Access Security (CASE) is only supported on .Net Framework; from net5.0 onwards it is marked obsolete which causes build warnings. For now, easiest to disable the warnings. If/when fully deprecated, it may be necessary to be a bit cleverer.
…ling when not on Windows Marshal.GetIUnknownForObject causes a CA1416 warning unless the code is only running on Windows. It is unclear how well Mono handles COM interoperability, so whether special handling is needed for Mono.
…tests for `DiagnostlicsLogger` There are `CAS1416` errors if attempting to use `EventLog` on `net6.0` without handling to ensure the platform is Windows, hence the need to use `SupportedOSPlatform` at the class level for the DiagnosticsLogger-related classes.
…ine to solution for ease of access
Having tweaked how static DiagnosticsLogger()
{
if (RunningOnMono() && string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MONO_EVENTLOG_TYPE")))
{
Environment.SetEnvironmentVariable("MONO_EVENTLOG_TYPE", "local:" + Environment.CurrentDirectory);
}
}
private static bool RunningOnMono()
{
// taken from http://www.mono-project.com/FAQ:_Technical
return Type.GetType("Mono.Runtime") != null;
} |
… `net6.0` Changed the generation from `net472` to `net6.0` due to errors when trying to load a `net6.0` assembly from `net472`
Not entirely sure why for commit e078044 the GitHub Ubuntu build failed to respect There are a few places I've had to make code "Windows only" which are probably worthy of review - I've generally limited this to when on |
|
The sole usage of DOTNET462 (PublicApiTestCase) now uses NET6_0. There are symbols such as NET462 and NET462_OR_GREATER (supplied by the SDK) if such switching is required in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mostly good to me! 👍 Apart from some comments, I really only have a single request:
Please check whether the Mono runtime guard for Marshal.IsComObject
, and the related additional NuGet dependency on net462
is truly necessary. I would personally have gone with simply suppressing the compiler warning instead.
Also, it seems that you're using a different username / email in your commits than on GitHub, is that intentional or did you want to change the commit author to match your GitHub profile?
I'd keep such a change out of this PR, since it isn't required for adding the |
Apologies for the delay getting back to this - have been swamped. Hoping to get on it again later this week. |
…teropServices.RuntimeInformation package on net462
I've tweaked the guards that were using the nuget package to work with preprocessor directives instead. Keen to keep the Windows checks in place for net6+ so that cross-platform consumers don't get unexpected errors.
This wasn't intentional, just an oversight, but I've added that email as a secondary on my account so it should all link up properly now - thanks for the prompt. I think I've covered what's been raised, except for squashing commits - not sure if that was just a preference for future reference, or a request for this PR? |
Cheers. Sorry for not getting to reviewing this again until now, last week was crazy.
Sounds good.
I'll have a browse through it again now. Just a preference, @stakx's commits are a clean masterpiece hiding all of his mess of back and forth 😆 . |
Adds
net6.0
as a target framework, including handling cases where functions are Windows-only fornet6.0
.