Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions PolyShim/Net60/Environment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// The following comment is required to instruct analyzers to skip this file
// <auto-generated/>

#if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD)
#nullable enable
// ReSharper disable RedundantUsingDirective
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable PartialTypeWithSinglePart

using System;
using System.Diagnostics;

internal static partial class PolyfillExtensions
{
extension(Environment)
{
// No Process class in .NET Standard 1.x
#if !NETSTANDARD || NETSTANDARD2_0_OR_GREATER
// https://learn.microsoft.com/dotnet/api/system.environment.processpath
public static string? ProcessPath
{
get
{
using var process = Process.GetCurrentProcess();
return process.MainModule?.FileName;
}
}
#endif
}
}
#endif
Loading