-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Avoid S.R.I.RuntimeInformation package dependency #85642
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,11 +106,15 @@ public static IServiceCollection AddWindowsService(this IServiceCollection servi | |
|
|
||
| private static void AddWindowsServiceLifetime(IServiceCollection services, Action<WindowsServiceLifetimeOptions> configure) | ||
| { | ||
| #if !NETFRAMEWORK | ||
| Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These don't seem all that valuable. According to 04442bf#r759693314 it's to workaround an issue in the analyzer. I wonder if that issue still exists?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Probably would still warn as I don't see any annotation or guard. Isn't it windows only? Then we might want to add |
||
| #endif | ||
|
|
||
| services.AddLogging(logging => | ||
| { | ||
| #if !NETFRAMEWORK | ||
| Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); | ||
| #endif | ||
| logging.AddEventLog(); | ||
| }); | ||
| services.AddSingleton<IHostLifetime, WindowsServiceLifetime>(); | ||
|
|
@@ -129,7 +133,9 @@ public EventLogSettingsSetup(IHostEnvironment environment) | |
|
|
||
| public void Configure(EventLogSettings settings) | ||
| { | ||
| #if !NETFRAMEWORK | ||
| Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); | ||
| #endif | ||
|
|
||
| if (string.IsNullOrEmpty(settings.SourceName)) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.