Decompiled source of SlopCrew v2.2.1

BepInEx/plugins/SlopCrew.Plugin/CrewBoomAPI.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("CrewBoomAPI")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("API to interact with Crew Boom.")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+1069d195e0cb08bb95407551b4c19397823315f8")]
[assembly: AssemblyProduct("CrewBoomAPI")]
[assembly: AssemblyTitle("CrewBoomAPI")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CrewBoomAPI
{
	public class CharacterInfo
	{
		public readonly string Name;

		public readonly string GraffitiName;

		public CharacterInfo(string name, string graffitiName)
		{
			Name = name;
			GraffitiName = graffitiName;
		}
	}
	public static class CrewBoomAPIDatabase
	{
		private static Dictionary<int, Guid> _userCharacters;

		public static bool IsInitialized { get; private set; }

		public static CharacterInfo PlayerCharacterInfo { get; private set; }

		public static event Action OnInitialized;

		public static event Action<Guid> OnOverride;

		public static event Action<CharacterInfo> OnPlayerCharacterInfoChanged;

		public static void Initialize(Dictionary<int, Guid> userCharacters)
		{
			_userCharacters = userCharacters;
			CrewBoomAPIDatabase.OnInitialized?.Invoke();
			IsInitialized = true;
		}

		public static void UpdatePlayerCharacter(CharacterInfo characterInfo)
		{
			PlayerCharacterInfo = characterInfo;
			CrewBoomAPIDatabase.OnPlayerCharacterInfoChanged?.Invoke(characterInfo);
		}

		public static bool GetUserGuidForCharacter(int character, out Guid guid)
		{
			guid = Guid.Empty;
			if (_userCharacters.TryGetValue(character, out guid))
			{
				return true;
			}
			return false;
		}

		public static void OverrideNextCharacterLoadedWithGuid(Guid guid)
		{
			CrewBoomAPIDatabase.OnOverride?.Invoke(guid);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Google.Protobuf.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Buffers.Binary;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Google.Protobuf.Collections;
using Google.Protobuf.Reflection;
using Google.Protobuf.WellKnownTypes;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: InternalsVisibleTo("Google.Protobuf.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010025800fbcfc63a17c66b303aae80b03a6beaa176bb6bef883be436f2a1579edd80ce23edf151a1f4ced97af83abcd981207041fd5b2da3b498346fcfcd94910d52f25537c4a43ce3fbe17dc7d43e6cbdb4d8f1242dcb6bd9b5906be74da8daa7d7280f97130f318a16c07baf118839b156299a48522f9fae2371c9665c5ae9cb6")]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: AssemblyCompany("Google Inc.")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright 2015, Google Inc.")]
[assembly: AssemblyDescription("C# runtime library for Protocol Buffers - Google's data interchange format.")]
[assembly: AssemblyFileVersion("3.25.0.0")]
[assembly: AssemblyInformationalVersion("3.25.0+7203caaae76f7a0fef892ece10aeae90959794db")]
[assembly: AssemblyProduct("Google.Protobuf")]
[assembly: AssemblyTitle("Google Protocol Buffers")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/protocolbuffers/protobuf.git")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.25.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsByRefLikeAttribute : Attribute
	{
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresUnreferencedCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresUnreferencedCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string Scope { get; set; }

		public string Target { get; set; }

		public string MessageId { get; set; }

		public string Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
}
namespace Google.Protobuf
{
	internal static class ByteArray
	{
		private const int CopyThreshold = 12;

		internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
		{
			if (count > 12)
			{
				Buffer.BlockCopy(src, srcOffset, dst, dstOffset, count);
				return;
			}
			int num = srcOffset + count;
			for (int i = srcOffset; i < num; i++)
			{
				dst[dstOffset++] = src[i];
			}
		}

		internal static void Reverse(byte[] bytes)
		{
			int num = 0;
			int num2 = bytes.Length - 1;
			while (num < num2)
			{
				byte b = bytes[num];
				bytes[num] = bytes[num2];
				bytes[num2] = b;
				num++;
				num2--;
			}
		}
	}
	[SecuritySafeCritical]
	[DebuggerDisplay("Length = {Length}")]
	[DebuggerTypeProxy(typeof(ByteStringDebugView))]
	public sealed class ByteString : IEnumerable<byte>, IEnumerable, IEquatable<ByteString>
	{
		private sealed class ByteStringDebugView
		{
			private readonly ByteString data;

			[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
			public byte[] Items => data.bytes.ToArray();

			public ByteStringDebugView(ByteString data)
			{
				this.data = data;
			}
		}

		private static readonly ByteString empty = new ByteString(new byte[0]);

		private readonly ReadOnlyMemory<byte> bytes;

		public static ByteString Empty => empty;

		public int Length => bytes.Length;

		public bool IsEmpty => Length == 0;

		public ReadOnlySpan<byte> Span => bytes.Span;

		public ReadOnlyMemory<byte> Memory => bytes;

		public byte this[int index] => bytes.Span[index];

		internal static ByteString AttachBytes(ReadOnlyMemory<byte> bytes)
		{
			return new ByteString(bytes);
		}

		internal static ByteString AttachBytes(byte[] bytes)
		{
			return AttachBytes(bytes.AsMemory());
		}

		private ByteString(ReadOnlyMemory<byte> bytes)
		{
			this.bytes = bytes;
		}

		public byte[] ToByteArray()
		{
			return bytes.ToArray();
		}

		public string ToBase64()
		{
			if (MemoryMarshal.TryGetArray(bytes, out var segment))
			{
				return Convert.ToBase64String(segment.Array, segment.Offset, segment.Count);
			}
			return Convert.ToBase64String(bytes.ToArray());
		}

		public static ByteString FromBase64(string bytes)
		{
			if (!(bytes == ""))
			{
				return new ByteString(Convert.FromBase64String(bytes));
			}
			return Empty;
		}

		public static ByteString FromStream(Stream stream)
		{
			ProtoPreconditions.CheckNotNull(stream, "stream");
			MemoryStream memoryStream = new MemoryStream(stream.CanSeek ? checked((int)(stream.Length - stream.Position)) : 0);
			stream.CopyTo(memoryStream);
			return AttachBytes((memoryStream.Length == memoryStream.Capacity) ? memoryStream.GetBuffer() : memoryStream.ToArray());
		}

		public static Task<ByteString> FromStreamAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
		{
			ProtoPreconditions.CheckNotNull(stream, "stream");
			return ByteStringAsync.FromStreamAsyncCore(stream, cancellationToken);
		}

		public static ByteString CopyFrom(params byte[] bytes)
		{
			return new ByteString((byte[])bytes.Clone());
		}

		public static ByteString CopyFrom(byte[] bytes, int offset, int count)
		{
			byte[] array = new byte[count];
			ByteArray.Copy(bytes, offset, array, 0, count);
			return new ByteString(array);
		}

		public static ByteString CopyFrom(ReadOnlySpan<byte> bytes)
		{
			return new ByteString(bytes.ToArray());
		}

		public static ByteString CopyFrom(string text, Encoding encoding)
		{
			return new ByteString(encoding.GetBytes(text));
		}

		public static ByteString CopyFromUtf8(string text)
		{
			return CopyFrom(text, Encoding.UTF8);
		}

		public string ToString(Encoding encoding)
		{
			if (MemoryMarshal.TryGetArray(bytes, out var segment))
			{
				return encoding.GetString(segment.Array, segment.Offset, segment.Count);
			}
			byte[] array = bytes.ToArray();
			return encoding.GetString(array, 0, array.Length);
		}

		public string ToStringUtf8()
		{
			return ToString(Encoding.UTF8);
		}

		[SecuritySafeCritical]
		public IEnumerator<byte> GetEnumerator()
		{
			return MemoryMarshal.ToEnumerable(bytes).GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		public CodedInputStream CreateCodedInput()
		{
			if (MemoryMarshal.TryGetArray(bytes, out var segment) && segment.Count == bytes.Length)
			{
				return new CodedInputStream(segment.Array, segment.Offset, segment.Count);
			}
			return new CodedInputStream(bytes.ToArray());
		}

		public static bool operator ==(ByteString lhs, ByteString rhs)
		{
			if ((object)lhs == rhs)
			{
				return true;
			}
			if ((object)lhs == null || (object)rhs == null)
			{
				return false;
			}
			return lhs.bytes.Span.SequenceEqual(rhs.bytes.Span);
		}

		public static bool operator !=(ByteString lhs, ByteString rhs)
		{
			return !(lhs == rhs);
		}

		[SecuritySafeCritical]
		public override bool Equals(object obj)
		{
			return this == obj as ByteString;
		}

		[SecuritySafeCritical]
		public override int GetHashCode()
		{
			ReadOnlySpan<byte> span = bytes.Span;
			int num = 23;
			for (int i = 0; i < span.Length; i++)
			{
				num = num * 31 + span[i];
			}
			return num;
		}

		public bool Equals(ByteString other)
		{
			return this == other;
		}

		public void CopyTo(byte[] array, int position)
		{
			bytes.CopyTo(array.AsMemory(position));
		}

		public void WriteTo(Stream outputStream)
		{
			if (MemoryMarshal.TryGetArray(bytes, out var segment))
			{
				outputStream.Write(segment.Array, segment.Offset, segment.Count);
				return;
			}
			byte[] array = bytes.ToArray();
			outputStream.Write(array, 0, array.Length);
		}
	}
	internal static class ByteStringAsync
	{
		internal static async Task<ByteString> FromStreamAsyncCore(Stream stream, CancellationToken cancellationToken)
		{
			int capacity = (stream.CanSeek ? checked((int)(stream.Length - stream.Position)) : 0);
			MemoryStream memoryStream = new MemoryStream(capacity);
			await stream.CopyToAsync(memoryStream, 81920, cancellationToken);
			return ByteString.AttachBytes((memoryStream.Length == memoryStream.Capacity) ? memoryStream.GetBuffer() : memoryStream.ToArray());
		}
	}
	[SecuritySafeCritical]
	public sealed class CodedInputStream : IDisposable
	{
		private readonly bool leaveOpen;

		private readonly byte[] buffer;

		private readonly Stream input;

		private ParserInternalState state;

		internal const int DefaultRecursionLimit = 100;

		internal const int DefaultSizeLimit = int.MaxValue;

		internal const int BufferSize = 4096;

		public long Position
		{
			get
			{
				if (input != null)
				{
					return input.Position - (state.bufferSize + state.bufferSizeAfterLimit - state.bufferPos);
				}
				return state.bufferPos;
			}
		}

		internal uint LastTag => state.lastTag;

		public int SizeLimit => state.sizeLimit;

		public int RecursionLimit => state.recursionLimit;

		internal bool DiscardUnknownFields
		{
			get
			{
				return state.DiscardUnknownFields;
			}
			set
			{
				state.DiscardUnknownFields = value;
			}
		}

		internal ExtensionRegistry ExtensionRegistry
		{
			get
			{
				return state.ExtensionRegistry;
			}
			set
			{
				state.ExtensionRegistry = value;
			}
		}

		internal byte[] InternalBuffer => buffer;

		internal Stream InternalInputStream => input;

		internal ref ParserInternalState InternalState => ref state;

		internal bool ReachedLimit => SegmentedBufferHelper.IsReachedLimit(ref state);

		public bool IsAtEnd
		{
			get
			{
				ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
				return SegmentedBufferHelper.IsAtEnd(ref readOnlySpan, ref state);
			}
		}

		public CodedInputStream(byte[] buffer)
			: this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), 0, buffer.Length, leaveOpen: true)
		{
		}

		public CodedInputStream(byte[] buffer, int offset, int length)
			: this(null, ProtoPreconditions.CheckNotNull(buffer, "buffer"), offset, offset + length, leaveOpen: true)
		{
			if (offset < 0 || offset > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("offset", "Offset must be within the buffer");
			}
			if (length < 0 || offset + length > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("length", "Length must be non-negative and within the buffer");
			}
		}

		public CodedInputStream(Stream input)
			: this(input, leaveOpen: false)
		{
		}

		public CodedInputStream(Stream input, bool leaveOpen)
			: this(ProtoPreconditions.CheckNotNull(input, "input"), new byte[4096], 0, 0, leaveOpen)
		{
		}

		internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, bool leaveOpen)
		{
			this.input = input;
			this.buffer = buffer;
			state.bufferPos = bufferPos;
			state.bufferSize = bufferSize;
			state.sizeLimit = int.MaxValue;
			state.recursionLimit = 100;
			SegmentedBufferHelper.Initialize(this, out state.segmentedBufferHelper);
			this.leaveOpen = leaveOpen;
			state.currentLimit = int.MaxValue;
		}

		internal CodedInputStream(Stream input, byte[] buffer, int bufferPos, int bufferSize, int sizeLimit, int recursionLimit, bool leaveOpen)
			: this(input, buffer, bufferPos, bufferSize, leaveOpen)
		{
			if (sizeLimit <= 0)
			{
				throw new ArgumentOutOfRangeException("sizeLimit", "Size limit must be positive");
			}
			if (recursionLimit <= 0)
			{
				throw new ArgumentOutOfRangeException("recursionLimit!", "Recursion limit must be positive");
			}
			state.sizeLimit = sizeLimit;
			state.recursionLimit = recursionLimit;
		}

		public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit)
		{
			return new CodedInputStream(input, new byte[4096], 0, 0, sizeLimit, recursionLimit, leaveOpen: false);
		}

		public void Dispose()
		{
			if (!leaveOpen)
			{
				input.Dispose();
			}
		}

		internal void CheckReadEndOfStreamTag()
		{
			ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref state);
		}

		public uint PeekTag()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.PeekTag(ref readOnlySpan, ref state);
		}

		public uint ReadTag()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseTag(ref readOnlySpan, ref state);
		}

		public void SkipLastField()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			ParsingPrimitivesMessages.SkipLastField(ref readOnlySpan, ref state);
		}

		internal void SkipGroup(uint startGroupTag)
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			ParsingPrimitivesMessages.SkipGroup(ref readOnlySpan, ref state, startGroupTag);
		}

		public double ReadDouble()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseDouble(ref readOnlySpan, ref state);
		}

		public float ReadFloat()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseFloat(ref readOnlySpan, ref state);
		}

		public ulong ReadUInt64()
		{
			return ReadRawVarint64();
		}

		public long ReadInt64()
		{
			return (long)ReadRawVarint64();
		}

		public int ReadInt32()
		{
			return (int)ReadRawVarint32();
		}

		public ulong ReadFixed64()
		{
			return ReadRawLittleEndian64();
		}

		public uint ReadFixed32()
		{
			return ReadRawLittleEndian32();
		}

		public bool ReadBool()
		{
			return ReadRawVarint64() != 0;
		}

		public string ReadString()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ReadString(ref readOnlySpan, ref state);
		}

		public void ReadMessage(IMessage builder)
		{
			ParseContext.Initialize(buffer.AsSpan(), ref state, out var ctx);
			try
			{
				ParsingPrimitivesMessages.ReadMessage(ref ctx, builder);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}

		public void ReadGroup(IMessage builder)
		{
			ParseContext.Initialize(this, out var ctx);
			try
			{
				ParsingPrimitivesMessages.ReadGroup(ref ctx, builder);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}

		public ByteString ReadBytes()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ReadBytes(ref readOnlySpan, ref state);
		}

		public uint ReadUInt32()
		{
			return ReadRawVarint32();
		}

		public int ReadEnum()
		{
			return (int)ReadRawVarint32();
		}

		public int ReadSFixed32()
		{
			return (int)ReadRawLittleEndian32();
		}

		public long ReadSFixed64()
		{
			return (long)ReadRawLittleEndian64();
		}

		public int ReadSInt32()
		{
			return ParsingPrimitives.DecodeZigZag32(ReadRawVarint32());
		}

		public long ReadSInt64()
		{
			return ParsingPrimitives.DecodeZigZag64(ReadRawVarint64());
		}

		public int ReadLength()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseLength(ref readOnlySpan, ref state);
		}

		public bool MaybeConsumeTag(uint tag)
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.MaybeConsumeTag(ref readOnlySpan, ref state, tag);
		}

		internal uint ReadRawVarint32()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseRawVarint32(ref readOnlySpan, ref state);
		}

		internal static uint ReadRawVarint32(Stream input)
		{
			return ParsingPrimitives.ReadRawVarint32(input);
		}

		internal ulong ReadRawVarint64()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseRawVarint64(ref readOnlySpan, ref state);
		}

		internal uint ReadRawLittleEndian32()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseRawLittleEndian32(ref readOnlySpan, ref state);
		}

		internal ulong ReadRawLittleEndian64()
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ParseRawLittleEndian64(ref readOnlySpan, ref state);
		}

		internal int PushLimit(int byteLimit)
		{
			return SegmentedBufferHelper.PushLimit(ref state, byteLimit);
		}

		internal void PopLimit(int oldLimit)
		{
			SegmentedBufferHelper.PopLimit(ref state, oldLimit);
		}

		internal byte[] ReadRawBytes(int size)
		{
			ReadOnlySpan<byte> readOnlySpan = new ReadOnlySpan<byte>(buffer);
			return ParsingPrimitives.ReadRawBytes(ref readOnlySpan, ref state, size);
		}

		public void ReadRawMessage(IMessage message)
		{
			ParseContext.Initialize(this, out var ctx);
			try
			{
				ParsingPrimitivesMessages.ReadRawMessage(ref ctx, message);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}
	}
	[SecuritySafeCritical]
	public sealed class CodedOutputStream : IDisposable
	{
		public sealed class OutOfSpaceException : IOException
		{
			internal OutOfSpaceException()
				: base("CodedOutputStream was writing to a flat byte array and ran out of space.")
			{
			}
		}

		private const int LittleEndian64Size = 8;

		private const int LittleEndian32Size = 4;

		internal const int DoubleSize = 8;

		internal const int FloatSize = 4;

		internal const int BoolSize = 1;

		public static readonly int DefaultBufferSize = 4096;

		private readonly bool leaveOpen;

		private readonly byte[] buffer;

		private WriterInternalState state;

		private readonly Stream output;

		public long Position
		{
			get
			{
				if (output != null)
				{
					return output.Position + state.position;
				}
				return state.position;
			}
		}

		public bool Deterministic { get; set; }

		public int SpaceLeft => WriteBufferHelper.GetSpaceLeft(ref state);

		internal byte[] InternalBuffer => buffer;

		internal Stream InternalOutputStream => output;

		internal ref WriterInternalState InternalState => ref state;

		public static int ComputeDoubleSize(double value)
		{
			return 8;
		}

		public static int ComputeFloatSize(float value)
		{
			return 4;
		}

		public static int ComputeUInt64Size(ulong value)
		{
			return ComputeRawVarint64Size(value);
		}

		public static int ComputeInt64Size(long value)
		{
			return ComputeRawVarint64Size((ulong)value);
		}

		public static int ComputeInt32Size(int value)
		{
			if (value >= 0)
			{
				return ComputeRawVarint32Size((uint)value);
			}
			return 10;
		}

		public static int ComputeFixed64Size(ulong value)
		{
			return 8;
		}

		public static int ComputeFixed32Size(uint value)
		{
			return 4;
		}

		public static int ComputeBoolSize(bool value)
		{
			return 1;
		}

		public static int ComputeStringSize(string value)
		{
			int byteCount = WritingPrimitives.Utf8Encoding.GetByteCount(value);
			return ComputeLengthSize(byteCount) + byteCount;
		}

		public static int ComputeGroupSize(IMessage value)
		{
			return value.CalculateSize();
		}

		public static int ComputeMessageSize(IMessage value)
		{
			int num = value.CalculateSize();
			return ComputeLengthSize(num) + num;
		}

		public static int ComputeBytesSize(ByteString value)
		{
			return ComputeLengthSize(value.Length) + value.Length;
		}

		public static int ComputeUInt32Size(uint value)
		{
			return ComputeRawVarint32Size(value);
		}

		public static int ComputeEnumSize(int value)
		{
			return ComputeInt32Size(value);
		}

		public static int ComputeSFixed32Size(int value)
		{
			return 4;
		}

		public static int ComputeSFixed64Size(long value)
		{
			return 8;
		}

		public static int ComputeSInt32Size(int value)
		{
			return ComputeRawVarint32Size(WritingPrimitives.EncodeZigZag32(value));
		}

		public static int ComputeSInt64Size(long value)
		{
			return ComputeRawVarint64Size(WritingPrimitives.EncodeZigZag64(value));
		}

		public static int ComputeLengthSize(int length)
		{
			return ComputeRawVarint32Size((uint)length);
		}

		public static int ComputeRawVarint32Size(uint value)
		{
			if ((value & 0xFFFFFF80u) == 0)
			{
				return 1;
			}
			if ((value & 0xFFFFC000u) == 0)
			{
				return 2;
			}
			if ((value & 0xFFE00000u) == 0)
			{
				return 3;
			}
			if ((value & 0xF0000000u) == 0)
			{
				return 4;
			}
			return 5;
		}

		public static int ComputeRawVarint64Size(ulong value)
		{
			if ((value & 0xFFFFFFFFFFFFFF80uL) == 0L)
			{
				return 1;
			}
			if ((value & 0xFFFFFFFFFFFFC000uL) == 0L)
			{
				return 2;
			}
			if ((value & 0xFFFFFFFFFFE00000uL) == 0L)
			{
				return 3;
			}
			if ((value & 0xFFFFFFFFF0000000uL) == 0L)
			{
				return 4;
			}
			if ((value & 0xFFFFFFF800000000uL) == 0L)
			{
				return 5;
			}
			if ((value & 0xFFFFFC0000000000uL) == 0L)
			{
				return 6;
			}
			if ((value & 0xFFFE000000000000uL) == 0L)
			{
				return 7;
			}
			if ((value & 0xFF00000000000000uL) == 0L)
			{
				return 8;
			}
			if ((value & 0x8000000000000000uL) == 0L)
			{
				return 9;
			}
			return 10;
		}

		public static int ComputeTagSize(int fieldNumber)
		{
			return ComputeRawVarint32Size(WireFormat.MakeTag(fieldNumber, WireFormat.WireType.Varint));
		}

		public CodedOutputStream(byte[] flatArray)
			: this(flatArray, 0, flatArray.Length)
		{
		}

		private CodedOutputStream(byte[] buffer, int offset, int length)
		{
			output = null;
			this.buffer = ProtoPreconditions.CheckNotNull(buffer, "buffer");
			state.position = offset;
			state.limit = offset + length;
			WriteBufferHelper.Initialize(this, out state.writeBufferHelper);
			leaveOpen = true;
		}

		private CodedOutputStream(Stream output, byte[] buffer, bool leaveOpen)
		{
			this.output = ProtoPreconditions.CheckNotNull(output, "output");
			this.buffer = buffer;
			state.position = 0;
			state.limit = buffer.Length;
			WriteBufferHelper.Initialize(this, out state.writeBufferHelper);
			this.leaveOpen = leaveOpen;
		}

		public CodedOutputStream(Stream output)
			: this(output, DefaultBufferSize, leaveOpen: false)
		{
		}

		public CodedOutputStream(Stream output, int bufferSize)
			: this(output, new byte[bufferSize], leaveOpen: false)
		{
		}

		public CodedOutputStream(Stream output, bool leaveOpen)
			: this(output, DefaultBufferSize, leaveOpen)
		{
		}

		public CodedOutputStream(Stream output, int bufferSize, bool leaveOpen)
			: this(output, new byte[bufferSize], leaveOpen)
		{
		}

		public void WriteDouble(double value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteDouble(ref span, ref state, value);
		}

		public void WriteFloat(float value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteFloat(ref span, ref state, value);
		}

		public void WriteUInt64(ulong value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteUInt64(ref span, ref state, value);
		}

		public void WriteInt64(long value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteInt64(ref span, ref state, value);
		}

		public void WriteInt32(int value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteInt32(ref span, ref state, value);
		}

		public void WriteFixed64(ulong value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteFixed64(ref span, ref state, value);
		}

		public void WriteFixed32(uint value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteFixed32(ref span, ref state, value);
		}

		public void WriteBool(bool value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteBool(ref span, ref state, value);
		}

		public void WriteString(string value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteString(ref span, ref state, value);
		}

		public void WriteMessage(IMessage value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WriteContext.Initialize(ref span, ref state, out var ctx);
			try
			{
				WritingPrimitivesMessages.WriteMessage(ref ctx, value);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}

		public void WriteRawMessage(IMessage value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WriteContext.Initialize(ref span, ref state, out var ctx);
			try
			{
				WritingPrimitivesMessages.WriteRawMessage(ref ctx, value);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}

		public void WriteGroup(IMessage value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WriteContext.Initialize(ref span, ref state, out var ctx);
			try
			{
				WritingPrimitivesMessages.WriteGroup(ref ctx, value);
			}
			finally
			{
				ctx.CopyStateTo(this);
			}
		}

		public void WriteBytes(ByteString value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteBytes(ref span, ref state, value);
		}

		public void WriteUInt32(uint value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteUInt32(ref span, ref state, value);
		}

		public void WriteEnum(int value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteEnum(ref span, ref state, value);
		}

		public void WriteSFixed32(int value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteSFixed32(ref span, ref state, value);
		}

		public void WriteSFixed64(long value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteSFixed64(ref span, ref state, value);
		}

		public void WriteSInt32(int value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteSInt32(ref span, ref state, value);
		}

		public void WriteSInt64(long value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteSInt64(ref span, ref state, value);
		}

		public void WriteLength(int length)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteLength(ref span, ref state, length);
		}

		public void WriteTag(int fieldNumber, WireFormat.WireType type)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteTag(ref span, ref state, fieldNumber, type);
		}

		public void WriteTag(uint tag)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteTag(ref span, ref state, tag);
		}

		public void WriteRawTag(byte b1)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawTag(ref span, ref state, b1);
		}

		public void WriteRawTag(byte b1, byte b2)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2);
		}

		public void WriteRawTag(byte b1, byte b2, byte b3)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3);
		}

		public void WriteRawTag(byte b1, byte b2, byte b3, byte b4)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4);
		}

		public void WriteRawTag(byte b1, byte b2, byte b3, byte b4, byte b5)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawTag(ref span, ref state, b1, b2, b3, b4, b5);
		}

		internal void WriteRawVarint32(uint value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawVarint32(ref span, ref state, value);
		}

		internal void WriteRawVarint64(ulong value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawVarint64(ref span, ref state, value);
		}

		internal void WriteRawLittleEndian32(uint value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawLittleEndian32(ref span, ref state, value);
		}

		internal void WriteRawLittleEndian64(ulong value)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawLittleEndian64(ref span, ref state, value);
		}

		internal void WriteRawBytes(byte[] value)
		{
			WriteRawBytes(value, 0, value.Length);
		}

		internal void WriteRawBytes(byte[] value, int offset, int length)
		{
			Span<byte> span = new Span<byte>(buffer);
			WritingPrimitives.WriteRawBytes(ref span, ref state, value, offset, length);
		}

		public void Dispose()
		{
			Flush();
			if (!leaveOpen)
			{
				output.Dispose();
			}
		}

		public void Flush()
		{
			Span<byte> span = new Span<byte>(buffer);
			WriteBufferHelper.Flush(ref span, ref state);
		}

		public void CheckNoSpaceLeft()
		{
			WriteBufferHelper.CheckNoSpaceLeft(ref state);
		}
	}
	public abstract class Extension
	{
		internal abstract System.Type TargetType { get; }

		public int FieldNumber { get; }

		internal abstract bool IsRepeated { get; }

		protected Extension(int fieldNumber)
		{
			FieldNumber = fieldNumber;
		}

		internal abstract IExtensionValue CreateValue();
	}
	public sealed class Extension<TTarget, TValue> : Extension where TTarget : IExtendableMessage<TTarget>
	{
		private readonly FieldCodec<TValue> codec;

		internal TValue DefaultValue
		{
			get
			{
				if (codec == null)
				{
					return default(TValue);
				}
				return codec.DefaultValue;
			}
		}

		internal override System.Type TargetType => typeof(TTarget);

		internal override bool IsRepeated => false;

		public Extension(int fieldNumber, FieldCodec<TValue> codec)
			: base(fieldNumber)
		{
			this.codec = codec;
		}

		internal override IExtensionValue CreateValue()
		{
			return new ExtensionValue<TValue>(codec);
		}
	}
	public sealed class RepeatedExtension<TTarget, TValue> : Extension where TTarget : IExtendableMessage<TTarget>
	{
		private readonly FieldCodec<TValue> codec;

		internal override System.Type TargetType => typeof(TTarget);

		internal override bool IsRepeated => true;

		public RepeatedExtension(int fieldNumber, FieldCodec<TValue> codec)
			: base(fieldNumber)
		{
			this.codec = codec;
		}

		internal override IExtensionValue CreateValue()
		{
			return new RepeatedExtensionValue<TValue>(codec);
		}
	}
	public sealed class ExtensionRegistry : ICollection<Extension>, IEnumerable<Extension>, IEnumerable, IDeepCloneable<ExtensionRegistry>
	{
		internal sealed class ExtensionComparer : IEqualityComparer<Extension>
		{
			internal static ExtensionComparer Instance = new ExtensionComparer();

			public bool Equals(Extension a, Extension b)
			{
				return new ObjectIntPair<System.Type>(a.TargetType, a.FieldNumber).Equals(new ObjectIntPair<System.Type>(b.TargetType, b.FieldNumber));
			}

			public int GetHashCode(Extension a)
			{
				return new ObjectIntPair<System.Type>(a.TargetType, a.FieldNumber).GetHashCode();
			}
		}

		private readonly IDictionary<ObjectIntPair<System.Type>, Extension> extensions;

		public int Count => extensions.Count;

		bool ICollection<Extension>.IsReadOnly => false;

		public ExtensionRegistry()
		{
			extensions = new Dictionary<ObjectIntPair<System.Type>, Extension>();
		}

		private ExtensionRegistry(IDictionary<ObjectIntPair<System.Type>, Extension> collection)
		{
			extensions = collection.ToDictionary((KeyValuePair<ObjectIntPair<System.Type>, Extension> k) => k.Key, (KeyValuePair<ObjectIntPair<System.Type>, Extension> v) => v.Value);
		}

		internal bool ContainsInputField(uint lastTag, System.Type target, out Extension extension)
		{
			return extensions.TryGetValue(new ObjectIntPair<System.Type>(target, WireFormat.GetTagFieldNumber(lastTag)), out extension);
		}

		public void Add(Extension extension)
		{
			ProtoPreconditions.CheckNotNull(extension, "extension");
			extensions.Add(new ObjectIntPair<System.Type>(extension.TargetType, extension.FieldNumber), extension);
		}

		public void AddRange(IEnumerable<Extension> extensions)
		{
			ProtoPreconditions.CheckNotNull(extensions, "extensions");
			foreach (Extension extension in extensions)
			{
				Add(extension);
			}
		}

		public void Clear()
		{
			extensions.Clear();
		}

		public bool Contains(Extension item)
		{
			ProtoPreconditions.CheckNotNull(item, "item");
			return extensions.ContainsKey(new ObjectIntPair<System.Type>(item.TargetType, item.FieldNumber));
		}

		void ICollection<Extension>.CopyTo(Extension[] array, int arrayIndex)
		{
			ProtoPreconditions.CheckNotNull(array, "array");
			if (arrayIndex < 0 || arrayIndex >= array.Length)
			{
				throw new ArgumentOutOfRangeException("arrayIndex");
			}
			if (array.Length - arrayIndex < Count)
			{
				throw new ArgumentException("The provided array is shorter than the number of elements in the registry");
			}
			foreach (Extension extension in array)
			{
				extensions.Add(new ObjectIntPair<System.Type>(extension.TargetType, extension.FieldNumber), extension);
			}
		}

		public IEnumerator<Extension> GetEnumerator()
		{
			return extensions.Values.GetEnumerator();
		}

		public bool Remove(Extension item)
		{
			ProtoPreconditions.CheckNotNull(item, "item");
			return extensions.Remove(new ObjectIntPair<System.Type>(item.TargetType, item.FieldNumber));
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		public ExtensionRegistry Clone()
		{
			return new ExtensionRegistry(extensions);
		}
	}
	public static class ExtensionSet
	{
		private static bool TryGetValue<TTarget>(ref ExtensionSet<TTarget> set, Extension extension, out IExtensionValue value) where TTarget : IExtendableMessage<TTarget>
		{
			if (set == null)
			{
				value = null;
				return false;
			}
			return set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value);
		}

		public static TValue Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			if (TryGetValue(ref set, extension, out var value))
			{
				if (value is ExtensionValue<TValue> extensionValue)
				{
					return extensionValue.GetValue();
				}
				object value2 = value.GetValue();
				if (value2 is TValue)
				{
					return (TValue)value2;
				}
				TypeInfo typeInfo = value.GetType().GetTypeInfo();
				if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(ExtensionValue<>))
				{
					System.Type type = typeInfo.GenericTypeArguments[0];
					throw new InvalidOperationException("The stored extension value has a type of '" + type.AssemblyQualifiedName + "'. This a different from the requested type of '" + typeof(TValue).AssemblyQualifiedName + "'.");
				}
				throw new InvalidOperationException("Unexpected extension value type: " + typeInfo.AssemblyQualifiedName);
			}
			return extension.DefaultValue;
		}

		public static RepeatedField<TValue> Get<TTarget, TValue>(ref ExtensionSet<TTarget> set, RepeatedExtension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			if (TryGetValue(ref set, extension, out var value))
			{
				if (value is RepeatedExtensionValue<TValue> repeatedExtensionValue)
				{
					return repeatedExtensionValue.GetValue();
				}
				TypeInfo typeInfo = value.GetType().GetTypeInfo();
				if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(RepeatedExtensionValue<>))
				{
					System.Type type = typeInfo.GenericTypeArguments[0];
					throw new InvalidOperationException("The stored extension value has a type of '" + type.AssemblyQualifiedName + "'. This a different from the requested type of '" + typeof(TValue).AssemblyQualifiedName + "'.");
				}
				throw new InvalidOperationException("Unexpected extension value type: " + typeInfo.AssemblyQualifiedName);
			}
			return null;
		}

		public static RepeatedField<TValue> GetOrInitialize<TTarget, TValue>(ref ExtensionSet<TTarget> set, RepeatedExtension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			IExtensionValue value;
			if (set == null)
			{
				value = extension.CreateValue();
				set = new ExtensionSet<TTarget>();
				set.ValuesByNumber.Add(extension.FieldNumber, value);
			}
			else if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value))
			{
				value = extension.CreateValue();
				set.ValuesByNumber.Add(extension.FieldNumber, value);
			}
			return ((RepeatedExtensionValue<TValue>)value).GetValue();
		}

		public static void Set<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension, TValue value) where TTarget : IExtendableMessage<TTarget>
		{
			ProtoPreconditions.CheckNotNullUnconstrained(value, "value");
			IExtensionValue value2;
			if (set == null)
			{
				value2 = extension.CreateValue();
				set = new ExtensionSet<TTarget>();
				set.ValuesByNumber.Add(extension.FieldNumber, value2);
			}
			else if (!set.ValuesByNumber.TryGetValue(extension.FieldNumber, out value2))
			{
				value2 = extension.CreateValue();
				set.ValuesByNumber.Add(extension.FieldNumber, value2);
			}
			((ExtensionValue<TValue>)value2).SetValue(value);
		}

		public static bool Has<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			IExtensionValue value;
			return TryGetValue(ref set, extension, out value);
		}

		public static void Clear<TTarget, TValue>(ref ExtensionSet<TTarget> set, Extension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			if (set != null)
			{
				set.ValuesByNumber.Remove(extension.FieldNumber);
				if (set.ValuesByNumber.Count == 0)
				{
					set = null;
				}
			}
		}

		public static void Clear<TTarget, TValue>(ref ExtensionSet<TTarget> set, RepeatedExtension<TTarget, TValue> extension) where TTarget : IExtendableMessage<TTarget>
		{
			if (set != null)
			{
				set.ValuesByNumber.Remove(extension.FieldNumber);
				if (set.ValuesByNumber.Count == 0)
				{
					set = null;
				}
			}
		}

		public static bool TryMergeFieldFrom<TTarget>(ref ExtensionSet<TTarget> set, CodedInputStream stream) where TTarget : IExtendableMessage<TTarget>
		{
			ParseContext.Initialize(stream, out var ctx);
			try
			{
				return TryMergeFieldFrom(ref set, ref ctx);
			}
			finally
			{
				ctx.CopyStateTo(stream);
			}
		}

		public static bool TryMergeFieldFrom<TTarget>(ref ExtensionSet<TTarget> set, ref ParseContext ctx) where TTarget : IExtendableMessage<TTarget>
		{
			int tagFieldNumber = WireFormat.GetTagFieldNumber(ctx.LastTag);
			if (set != null && set.ValuesByNumber.TryGetValue(tagFieldNumber, out var value))
			{
				value.MergeFrom(ref ctx);
				return true;
			}
			if (ctx.ExtensionRegistry != null && ctx.ExtensionRegistry.ContainsInputField(ctx.LastTag, typeof(TTarget), out var extension))
			{
				IExtensionValue extensionValue = extension.CreateValue();
				extensionValue.MergeFrom(ref ctx);
				if (set == null)
				{
					set = new ExtensionSet<TTarget>();
				}
				set.ValuesByNumber.Add(extension.FieldNumber, extensionValue);
				return true;
			}
			return false;
		}

		public static void MergeFrom<TTarget>(ref ExtensionSet<TTarget> first, ExtensionSet<TTarget> second) where TTarget : IExtendableMessage<TTarget>
		{
			if (second == null)
			{
				return;
			}
			if (first == null)
			{
				first = new ExtensionSet<TTarget>();
			}
			foreach (KeyValuePair<int, IExtensionValue> item in second.ValuesByNumber)
			{
				if (first.ValuesByNumber.TryGetValue(item.Key, out var value))
				{
					value.MergeFrom(item.Value);
					continue;
				}
				IExtensionValue value2 = item.Value.Clone();
				first.ValuesByNumber[item.Key] = value2;
			}
		}

		public static ExtensionSet<TTarget> Clone<TTarget>(ExtensionSet<TTarget> set) where TTarget : IExtendableMessage<TTarget>
		{
			if (set == null)
			{
				return null;
			}
			ExtensionSet<TTarget> extensionSet = new ExtensionSet<TTarget>();
			foreach (KeyValuePair<int, IExtensionValue> item in set.ValuesByNumber)
			{
				IExtensionValue value = item.Value.Clone();
				extensionSet.ValuesByNumber[item.Key] = value;
			}
			return extensionSet;
		}
	}
	public sealed class ExtensionSet<TTarget> where TTarget : IExtendableMessage<TTarget>
	{
		internal Dictionary<int, IExtensionValue> ValuesByNumber { get; } = new Dictionary<int, IExtensionValue>();


		public override int GetHashCode()
		{
			int num = typeof(TTarget).GetHashCode();
			foreach (KeyValuePair<int, IExtensionValue> item in ValuesByNumber)
			{
				int num2 = item.Key.GetHashCode() ^ item.Value.GetHashCode();
				num ^= num2;
			}
			return num;
		}

		public override bool Equals(object other)
		{
			if (this == other)
			{
				return true;
			}
			ExtensionSet<TTarget> extensionSet = other as ExtensionSet<TTarget>;
			if (ValuesByNumber.Count != extensionSet.ValuesByNumber.Count)
			{
				return false;
			}
			foreach (KeyValuePair<int, IExtensionValue> item in ValuesByNumber)
			{
				if (!extensionSet.ValuesByNumber.TryGetValue(item.Key, out var value))
				{
					return false;
				}
				if (!item.Value.Equals(value))
				{
					return false;
				}
			}
			return true;
		}

		public int CalculateSize()
		{
			int num = 0;
			foreach (IExtensionValue value in ValuesByNumber.Values)
			{
				num += value.CalculateSize();
			}
			return num;
		}

		public void WriteTo(CodedOutputStream stream)
		{
			WriteContext.Initialize(stream, out var ctx);
			try
			{
				WriteTo(ref ctx);
			}
			finally
			{
				ctx.CopyStateTo(stream);
			}
		}

		[SecuritySafeCritical]
		public void WriteTo(ref WriteContext ctx)
		{
			foreach (IExtensionValue value in ValuesByNumber.Values)
			{
				value.WriteTo(ref ctx);
			}
		}

		internal bool IsInitialized()
		{
			return ValuesByNumber.Values.All((IExtensionValue v) => v.IsInitialized());
		}
	}
	internal interface IExtensionValue : IEquatable<IExtensionValue>, IDeepCloneable<IExtensionValue>
	{
		void MergeFrom(ref ParseContext ctx);

		void MergeFrom(IExtensionValue value);

		void WriteTo(ref WriteContext ctx);

		int CalculateSize();

		bool IsInitialized();

		object GetValue();
	}
	internal sealed class ExtensionValue<T> : IExtensionValue, IEquatable<IExtensionValue>, IDeepCloneable<IExtensionValue>
	{
		private T field;

		private readonly FieldCodec<T> codec;

		internal ExtensionValue(FieldCodec<T> codec)
		{
			this.codec = codec;
			field = codec.DefaultValue;
		}

		public int CalculateSize()
		{
			return codec.CalculateUnconditionalSizeWithTag(field);
		}

		public IExtensionValue Clone()
		{
			return new ExtensionValue<T>(codec)
			{
				field = ((field is IDeepCloneable<T>) ? (field as IDeepCloneable<T>).Clone() : field)
			};
		}

		public bool Equals(IExtensionValue other)
		{
			if (this == other)
			{
				return true;
			}
			if (other is ExtensionValue<T> && codec.Equals((other as ExtensionValue<T>).codec))
			{
				return object.Equals(field, (other as ExtensionValue<T>).field);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return (17 * 31 + field.GetHashCode()) * 31 + codec.GetHashCode();
		}

		public void MergeFrom(ref ParseContext ctx)
		{
			codec.ValueMerger(ref ctx, ref field);
		}

		public void MergeFrom(IExtensionValue value)
		{
			if (value is ExtensionValue<T>)
			{
				ExtensionValue<T> extensionValue = value as ExtensionValue<T>;
				codec.FieldMerger(ref field, extensionValue.field);
			}
		}

		public void WriteTo(ref WriteContext ctx)
		{
			ctx.WriteTag(codec.Tag);
			codec.ValueWriter(ref ctx, field);
			if (codec.EndTag != 0)
			{
				ctx.WriteTag(codec.EndTag);
			}
		}

		public T GetValue()
		{
			return field;
		}

		object IExtensionValue.GetValue()
		{
			return field;
		}

		public void SetValue(T value)
		{
			field = value;
		}

		public bool IsInitialized()
		{
			if (field is IMessage)
			{
				return (field as IMessage).IsInitialized();
			}
			return true;
		}
	}
	internal sealed class RepeatedExtensionValue<T> : IExtensionValue, IEquatable<IExtensionValue>, IDeepCloneable<IExtensionValue>
	{
		private RepeatedField<T> field;

		private readonly FieldCodec<T> codec;

		internal RepeatedExtensionValue(FieldCodec<T> codec)
		{
			this.codec = codec;
			field = new RepeatedField<T>();
		}

		public int CalculateSize()
		{
			return field.CalculateSize(codec);
		}

		public IExtensionValue Clone()
		{
			return new RepeatedExtensionValue<T>(codec)
			{
				field = field.Clone()
			};
		}

		public bool Equals(IExtensionValue other)
		{
			if (this == other)
			{
				return true;
			}
			if (other is RepeatedExtensionValue<T> && field.Equals((other as RepeatedExtensionValue<T>).field))
			{
				return codec.Equals((other as RepeatedExtensionValue<T>).codec);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return (17 * 31 + field.GetHashCode()) * 31 + codec.GetHashCode();
		}

		public void MergeFrom(ref ParseContext ctx)
		{
			field.AddEntriesFrom(ref ctx, codec);
		}

		public void MergeFrom(IExtensionValue value)
		{
			if (value is RepeatedExtensionValue<T>)
			{
				field.Add((value as RepeatedExtensionValue<T>).field);
			}
		}

		public void WriteTo(ref WriteContext ctx)
		{
			field.WriteTo(ref ctx, codec);
		}

		public RepeatedField<T> GetValue()
		{
			return field;
		}

		object IExtensionValue.GetValue()
		{
			return field;
		}

		public bool IsInitialized()
		{
			for (int i = 0; i < field.Count; i++)
			{
				T val = field[i];
				if (!(val is IMessage))
				{
					break;
				}
				if (!(val as IMessage).IsInitialized())
				{
					return false;
				}
			}
			return true;
		}
	}
	public static class FieldCodec
	{
		private static class WrapperCodecs
		{
			private static readonly Dictionary<System.Type, object> Codecs = new Dictionary<System.Type, object>
			{
				{
					typeof(bool),
					ForBool(WireFormat.MakeTag(1, WireFormat.WireType.Varint))
				},
				{
					typeof(int),
					ForInt32(WireFormat.MakeTag(1, WireFormat.WireType.Varint))
				},
				{
					typeof(long),
					ForInt64(WireFormat.MakeTag(1, WireFormat.WireType.Varint))
				},
				{
					typeof(uint),
					ForUInt32(WireFormat.MakeTag(1, WireFormat.WireType.Varint))
				},
				{
					typeof(ulong),
					ForUInt64(WireFormat.MakeTag(1, WireFormat.WireType.Varint))
				},
				{
					typeof(float),
					ForFloat(WireFormat.MakeTag(1, WireFormat.WireType.Fixed32))
				},
				{
					typeof(double),
					ForDouble(WireFormat.MakeTag(1, WireFormat.WireType.Fixed64))
				},
				{
					typeof(string),
					ForString(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited))
				},
				{
					typeof(ByteString),
					ForBytes(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited))
				}
			};

			private static readonly Dictionary<System.Type, object> Readers = new Dictionary<System.Type, object>
			{
				{
					typeof(bool),
					new ValueReader<bool?>(ParsingPrimitivesWrappers.ReadBoolWrapper)
				},
				{
					typeof(int),
					new ValueReader<int?>(ParsingPrimitivesWrappers.ReadInt32Wrapper)
				},
				{
					typeof(long),
					new ValueReader<long?>(ParsingPrimitivesWrappers.ReadInt64Wrapper)
				},
				{
					typeof(uint),
					new ValueReader<uint?>(ParsingPrimitivesWrappers.ReadUInt32Wrapper)
				},
				{
					typeof(ulong),
					new ValueReader<ulong?>(ParsingPrimitivesWrappers.ReadUInt64Wrapper)
				},
				{
					typeof(float),
					BitConverter.IsLittleEndian ? new ValueReader<float?>(ParsingPrimitivesWrappers.ReadFloatWrapperLittleEndian) : new ValueReader<float?>(ParsingPrimitivesWrappers.ReadFloatWrapperSlow)
				},
				{
					typeof(double),
					BitConverter.IsLittleEndian ? new ValueReader<double?>(ParsingPrimitivesWrappers.ReadDoubleWrapperLittleEndian) : new ValueReader<double?>(ParsingPrimitivesWrappers.ReadDoubleWrapperSlow)
				},
				{
					typeof(string),
					null
				},
				{
					typeof(ByteString),
					null
				}
			};

			internal static FieldCodec<T> GetCodec<T>()
			{
				if (!Codecs.TryGetValue(typeof(T), out var value))
				{
					throw new InvalidOperationException("Invalid type argument requested for wrapper codec: " + typeof(T));
				}
				return (FieldCodec<T>)value;
			}

			internal static ValueReader<T?> GetReader<T>() where T : struct
			{
				if (!Readers.TryGetValue(typeof(T), out var value))
				{
					throw new InvalidOperationException("Invalid type argument requested for wrapper reader: " + typeof(T));
				}
				if (value == null)
				{
					FieldCodec<T> nestedCoded = GetCodec<T>();
					return delegate(ref ParseContext ctx)
					{
						return Read(ref ctx, nestedCoded);
					};
				}
				return (ValueReader<T?>)value;
			}

			[SecuritySafeCritical]
			internal static T Read<T>(ref ParseContext ctx, FieldCodec<T> codec)
			{
				int byteLimit = ctx.ReadLength();
				int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, byteLimit);
				T result = codec.DefaultValue;
				uint num;
				while ((num = ctx.ReadTag()) != 0)
				{
					if (num == codec.Tag)
					{
						result = codec.Read(ref ctx);
					}
					else
					{
						ParsingPrimitivesMessages.SkipLastField(ref ctx.buffer, ref ctx.state);
					}
				}
				ParsingPrimitivesMessages.CheckReadEndOfStreamTag(ref ctx.state);
				SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit);
				return result;
			}

			internal static void Write<T>(ref WriteContext ctx, T value, FieldCodec<T> codec)
			{
				ctx.WriteLength(codec.CalculateSizeWithTag(value));
				codec.WriteTagAndValue(ref ctx, value);
			}

			internal static int CalculateSize<T>(T value, FieldCodec<T> codec)
			{
				int num = codec.CalculateSizeWithTag(value);
				return CodedOutputStream.ComputeLengthSize(num) + num;
			}
		}

		public static FieldCodec<string> ForString(uint tag)
		{
			return ForString(tag, "");
		}

		public static FieldCodec<ByteString> ForBytes(uint tag)
		{
			return ForBytes(tag, ByteString.Empty);
		}

		public static FieldCodec<bool> ForBool(uint tag)
		{
			return ForBool(tag, defaultValue: false);
		}

		public static FieldCodec<int> ForInt32(uint tag)
		{
			return ForInt32(tag, 0);
		}

		public static FieldCodec<int> ForSInt32(uint tag)
		{
			return ForSInt32(tag, 0);
		}

		public static FieldCodec<uint> ForFixed32(uint tag)
		{
			return ForFixed32(tag, 0u);
		}

		public static FieldCodec<int> ForSFixed32(uint tag)
		{
			return ForSFixed32(tag, 0);
		}

		public static FieldCodec<uint> ForUInt32(uint tag)
		{
			return ForUInt32(tag, 0u);
		}

		public static FieldCodec<long> ForInt64(uint tag)
		{
			return ForInt64(tag, 0L);
		}

		public static FieldCodec<long> ForSInt64(uint tag)
		{
			return ForSInt64(tag, 0L);
		}

		public static FieldCodec<ulong> ForFixed64(uint tag)
		{
			return ForFixed64(tag, 0uL);
		}

		public static FieldCodec<long> ForSFixed64(uint tag)
		{
			return ForSFixed64(tag, 0L);
		}

		public static FieldCodec<ulong> ForUInt64(uint tag)
		{
			return ForUInt64(tag, 0uL);
		}

		public static FieldCodec<float> ForFloat(uint tag)
		{
			return ForFloat(tag, 0f);
		}

		public static FieldCodec<double> ForDouble(uint tag)
		{
			return ForDouble(tag, 0.0);
		}

		public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32)
		{
			return ForEnum(tag, toInt32, fromInt32, default(T));
		}

		public static FieldCodec<string> ForString(uint tag, string defaultValue)
		{
			return new FieldCodec<string>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadString();
			}, delegate(ref WriteContext ctx, string value)
			{
				ctx.WriteString(value);
			}, CodedOutputStream.ComputeStringSize, tag, defaultValue);
		}

		public static FieldCodec<ByteString> ForBytes(uint tag, ByteString defaultValue)
		{
			return new FieldCodec<ByteString>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadBytes();
			}, delegate(ref WriteContext ctx, ByteString value)
			{
				ctx.WriteBytes(value);
			}, CodedOutputStream.ComputeBytesSize, tag, defaultValue);
		}

		public static FieldCodec<bool> ForBool(uint tag, bool defaultValue)
		{
			return new FieldCodec<bool>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadBool();
			}, delegate(ref WriteContext ctx, bool value)
			{
				ctx.WriteBool(value);
			}, 1, tag, defaultValue);
		}

		public static FieldCodec<int> ForInt32(uint tag, int defaultValue)
		{
			return new FieldCodec<int>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadInt32();
			}, delegate(ref WriteContext output, int value)
			{
				output.WriteInt32(value);
			}, CodedOutputStream.ComputeInt32Size, tag, defaultValue);
		}

		public static FieldCodec<int> ForSInt32(uint tag, int defaultValue)
		{
			return new FieldCodec<int>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadSInt32();
			}, delegate(ref WriteContext output, int value)
			{
				output.WriteSInt32(value);
			}, CodedOutputStream.ComputeSInt32Size, tag, defaultValue);
		}

		public static FieldCodec<uint> ForFixed32(uint tag, uint defaultValue)
		{
			return new FieldCodec<uint>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadFixed32();
			}, delegate(ref WriteContext output, uint value)
			{
				output.WriteFixed32(value);
			}, 4, tag, defaultValue);
		}

		public static FieldCodec<int> ForSFixed32(uint tag, int defaultValue)
		{
			return new FieldCodec<int>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadSFixed32();
			}, delegate(ref WriteContext output, int value)
			{
				output.WriteSFixed32(value);
			}, 4, tag, defaultValue);
		}

		public static FieldCodec<uint> ForUInt32(uint tag, uint defaultValue)
		{
			return new FieldCodec<uint>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadUInt32();
			}, delegate(ref WriteContext output, uint value)
			{
				output.WriteUInt32(value);
			}, CodedOutputStream.ComputeUInt32Size, tag, defaultValue);
		}

		public static FieldCodec<long> ForInt64(uint tag, long defaultValue)
		{
			return new FieldCodec<long>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadInt64();
			}, delegate(ref WriteContext output, long value)
			{
				output.WriteInt64(value);
			}, CodedOutputStream.ComputeInt64Size, tag, defaultValue);
		}

		public static FieldCodec<long> ForSInt64(uint tag, long defaultValue)
		{
			return new FieldCodec<long>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadSInt64();
			}, delegate(ref WriteContext output, long value)
			{
				output.WriteSInt64(value);
			}, CodedOutputStream.ComputeSInt64Size, tag, defaultValue);
		}

		public static FieldCodec<ulong> ForFixed64(uint tag, ulong defaultValue)
		{
			return new FieldCodec<ulong>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadFixed64();
			}, delegate(ref WriteContext output, ulong value)
			{
				output.WriteFixed64(value);
			}, 8, tag, defaultValue);
		}

		public static FieldCodec<long> ForSFixed64(uint tag, long defaultValue)
		{
			return new FieldCodec<long>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadSFixed64();
			}, delegate(ref WriteContext output, long value)
			{
				output.WriteSFixed64(value);
			}, 8, tag, defaultValue);
		}

		public static FieldCodec<ulong> ForUInt64(uint tag, ulong defaultValue)
		{
			return new FieldCodec<ulong>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadUInt64();
			}, delegate(ref WriteContext output, ulong value)
			{
				output.WriteUInt64(value);
			}, CodedOutputStream.ComputeUInt64Size, tag, defaultValue);
		}

		public static FieldCodec<float> ForFloat(uint tag, float defaultValue)
		{
			return new FieldCodec<float>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadFloat();
			}, delegate(ref WriteContext output, float value)
			{
				output.WriteFloat(value);
			}, 4, tag, defaultValue);
		}

		public static FieldCodec<double> ForDouble(uint tag, double defaultValue)
		{
			return new FieldCodec<double>(delegate(ref ParseContext ctx)
			{
				return ctx.ReadDouble();
			}, delegate(ref WriteContext output, double value)
			{
				output.WriteDouble(value);
			}, 8, tag, defaultValue);
		}

		public static FieldCodec<T> ForEnum<T>(uint tag, Func<T, int> toInt32, Func<int, T> fromInt32, T defaultValue)
		{
			return new FieldCodec<T>(delegate(ref ParseContext ctx)
			{
				return fromInt32(ctx.ReadEnum());
			}, delegate(ref WriteContext output, T value)
			{
				output.WriteEnum(toInt32(value));
			}, (T value) => CodedOutputStream.ComputeEnumSize(toInt32(value)), tag, defaultValue);
		}

		public static FieldCodec<T> ForMessage<T>(uint tag, MessageParser<T> parser) where T : class, IMessage<T>
		{
			return new FieldCodec<T>(delegate(ref ParseContext ctx)
			{
				T val = parser.CreateTemplate();
				ctx.ReadMessage(val);
				return val;
			}, delegate(ref WriteContext output, T value)
			{
				output.WriteMessage(value);
			}, delegate(ref ParseContext ctx, ref T v)
			{
				if (v == null)
				{
					v = parser.CreateTemplate();
				}
				ctx.ReadMessage(v);
			}, delegate(ref T v, T v2)
			{
				if (v2 == null)
				{
					return false;
				}
				if (v == null)
				{
					v = v2.Clone();
				}
				else
				{
					v.MergeFrom(v2);
				}
				return true;
			}, (T message) => CodedOutputStream.ComputeMessageSize(message), tag);
		}

		public static FieldCodec<T> ForGroup<T>(uint startTag, uint endTag, MessageParser<T> parser) where T : class, IMessage<T>
		{
			return new FieldCodec<T>(delegate(ref ParseContext ctx)
			{
				T val = parser.CreateTemplate();
				ctx.ReadGroup(val);
				return val;
			}, delegate(ref WriteContext output, T value)
			{
				output.WriteGroup(value);
			}, delegate(ref ParseContext ctx, ref T v)
			{
				if (v == null)
				{
					v = parser.CreateTemplate();
				}
				ctx.ReadGroup(v);
			}, delegate(ref T v, T v2)
			{
				if (v2 == null)
				{
					return v == null;
				}
				if (v == null)
				{
					v = v2.Clone();
				}
				else
				{
					v.MergeFrom(v2);
				}
				return true;
			}, (T message) => CodedOutputStream.ComputeGroupSize(message), startTag, endTag);
		}

		public static FieldCodec<T> ForClassWrapper<T>(uint tag) where T : class
		{
			FieldCodec<T> nestedCodec = WrapperCodecs.GetCodec<T>();
			return new FieldCodec<T>(delegate(ref ParseContext ctx)
			{
				return WrapperCodecs.Read(ref ctx, nestedCodec);
			}, delegate(ref WriteContext output, T value)
			{
				WrapperCodecs.Write(ref output, value, nestedCodec);
			}, delegate(ref ParseContext ctx, ref T v)
			{
				v = WrapperCodecs.Read(ref ctx, nestedCodec);
			}, delegate(ref T v, T v2)
			{
				v = v2;
				return v == null;
			}, (T value) => WrapperCodecs.CalculateSize(value, nestedCodec), tag, 0u, null);
		}

		public static FieldCodec<T?> ForStructWrapper<T>(uint tag) where T : struct
		{
			FieldCodec<T> nestedCodec = WrapperCodecs.GetCodec<T>();
			return new FieldCodec<T?>(WrapperCodecs.GetReader<T>(), delegate(ref WriteContext output, T? value)
			{
				WrapperCodecs.Write(ref output, value.Value, nestedCodec);
			}, delegate(ref ParseContext ctx, ref T? v)
			{
				v = WrapperCodecs.Read(ref ctx, nestedCodec);
			}, delegate(ref T? v, T? v2)
			{
				if (v2.HasValue)
				{
					v = v2;
				}
				return v.HasValue;
			}, (T? value) => value.HasValue ? WrapperCodecs.CalculateSize(value.Value, nestedCodec) : 0, tag, 0u, null);
		}
	}
	internal delegate TValue ValueReader<out TValue>(ref ParseContext ctx);
	internal delegate void ValueWriter<T>(ref WriteContext ctx, T value);
	public sealed class FieldCodec<T>
	{
		internal delegate void InputMerger(ref ParseContext ctx, ref T value);

		internal delegate bool ValuesMerger(ref T value, T other);

		private static readonly EqualityComparer<T> EqualityComparer;

		private static readonly T DefaultDefault;

		private static readonly bool TypeSupportsPacking;

		private readonly int tagSize;

		internal bool PackedRepeatedField { get; }

		internal ValueWriter<T> ValueWriter { get; }

		internal Func<T, int> ValueSizeCalculator { get; }

		internal ValueReader<T> ValueReader { get; }

		internal InputMerger ValueMerger { get; }

		internal ValuesMerger FieldMerger { get; }

		internal int FixedSize { get; }

		internal uint Tag { get; }

		internal uint EndTag { get; }

		internal T DefaultValue { get; }

		static FieldCodec()
		{
			EqualityComparer = ProtobufEqualityComparers.GetEqualityComparer<T>();
			TypeSupportsPacking = default(T) != null;
			if (typeof(T) == typeof(string))
			{
				DefaultDefault = (T)(object)"";
			}
			else if (typeof(T) == typeof(ByteString))
			{
				DefaultDefault = (T)(object)ByteString.Empty;
			}
		}

		internal static bool IsPackedRepeatedField(uint tag)
		{
			if (TypeSupportsPacking)
			{
				return WireFormat.GetTagWireType(tag) == WireFormat.WireType.LengthDelimited;
			}
			return false;
		}

		internal FieldCodec(ValueReader<T> reader, ValueWriter<T> writer, int fixedSize, uint tag, T defaultValue)
			: this(reader, writer, (Func<T, int>)((T _) => fixedSize), tag, defaultValue)
		{
			FixedSize = fixedSize;
		}

		internal FieldCodec(ValueReader<T> reader, ValueWriter<T> writer, Func<T, int> sizeCalculator, uint tag, T defaultValue)
			: this(reader, writer, (InputMerger)delegate(ref ParseContext ctx, ref T v)
			{
				v = reader(ref ctx);
			}, (ValuesMerger)delegate(ref T v, T v2)
			{
				v = v2;
				return true;
			}, sizeCalculator, tag, 0u, defaultValue)
		{
		}

		internal FieldCodec(ValueReader<T> reader, ValueWriter<T> writer, InputMerger inputMerger, ValuesMerger valuesMerger, Func<T, int> sizeCalculator, uint tag, uint endTag = 0u)
			: this(reader, writer, inputMerger, valuesMerger, sizeCalculator, tag, endTag, DefaultDefault)
		{
		}

		internal FieldCodec(ValueReader<T> reader, ValueWriter<T> writer, InputMerger inputMerger, ValuesMerger valuesMerger, Func<T, int> sizeCalculator, uint tag, uint endTag, T defaultValue)
		{
			ValueReader = reader;
			ValueWriter = writer;
			ValueMerger = inputMerger;
			FieldMerger = valuesMerger;
			ValueSizeCalculator = sizeCalculator;
			FixedSize = 0;
			Tag = tag;
			EndTag = endTag;
			DefaultValue = defaultValue;
			tagSize = CodedOutputStream.ComputeRawVarint32Size(tag);
			if (endTag != 0)
			{
				tagSize += CodedOutputStream.ComputeRawVarint32Size(endTag);
			}
			PackedRepeatedField = IsPackedRepeatedField(tag);
		}

		public void WriteTagAndValue(CodedOutputStream output, T value)
		{
			WriteContext.Initialize(output, out var ctx);
			try
			{
				WriteTagAndValue(ref ctx, value);
			}
			finally
			{
				ctx.CopyStateTo(output);
			}
		}

		public void WriteTagAndValue(ref WriteContext ctx, T value)
		{
			if (!IsDefault(value))
			{
				ctx.WriteTag(Tag);
				ValueWriter(ref ctx, value);
				if (EndTag != 0)
				{
					ctx.WriteTag(EndTag);
				}
			}
		}

		public T Read(CodedInputStream input)
		{
			ParseContext.Initialize(input, out var ctx);
			try
			{
				return ValueReader(ref ctx);
			}
			finally
			{
				ctx.CopyStateTo(input);
			}
		}

		public T Read(ref ParseContext ctx)
		{
			return ValueReader(ref ctx);
		}

		public int CalculateSizeWithTag(T value)
		{
			if (!IsDefault(value))
			{
				return ValueSizeCalculator(value) + tagSize;
			}
			return 0;
		}

		internal int CalculateUnconditionalSizeWithTag(T value)
		{
			return ValueSizeCalculator(value) + tagSize;
		}

		private bool IsDefault(T value)
		{
			return EqualityComparer.Equals(value, DefaultValue);
		}
	}
	internal sealed class FieldMaskTree
	{
		internal sealed class Node
		{
			public Dictionary<string, Node> Children { get; } = new Dictionary<string, Node>();

		}

		private const char FIELD_PATH_SEPARATOR = '.';

		private readonly Node root = new Node();

		public FieldMaskTree()
		{
		}

		public FieldMaskTree(FieldMask mask)
		{
			MergeFromFieldMask(mask);
		}

		public override string ToString()
		{
			return ToFieldMask().ToString();
		}

		public FieldMaskTree AddFieldPath(string path)
		{
			string[] array = path.Split(new char[1] { '.' });
			if (array.Length == 0)
			{
				return this;
			}
			Node node = root;
			bool flag = false;
			string[] array2 = array;
			foreach (string key in array2)
			{
				if (!flag && node != root && node.Children.Count == 0)
				{
					return this;
				}
				if (!node.Children.TryGetValue(key, out var value))
				{
					flag = true;
					value = new Node();
					node.Children.Add(key, value);
				}
				node = value;
			}
			node.Children.Clear();
			return this;
		}

		public FieldMaskTree MergeFromFieldMask(FieldMask mask)
		{
			foreach (string path in mask.Paths)
			{
				AddFieldPath(path);
			}
			return this;
		}

		public FieldMask ToFieldMask()
		{
			FieldMask fieldMask = new FieldMask();
			if (root.Children.Count != 0)
			{
				List<string> list = new List<string>();
				GetFieldPaths(root, "", list);
				fieldMask.Paths.AddRange(list);
			}
			return fieldMask;
		}

		private void GetFieldPaths(Node node, string path, List<string> paths)
		{
			if (node.Children.Count == 0)
			{
				paths.Add(path);
				return;
			}
			foreach (KeyValuePair<string, Node> child in node.Children)
			{
				string path2 = ((path.Length == 0) ? child.Key : (path + "." + child.Key));
				GetFieldPaths(child.Value, path2, paths);
			}
		}

		public void IntersectFieldPath(string path, FieldMaskTree output)
		{
			if (root.Children.Count == 0)
			{
				return;
			}
			string[] array = path.Split(new char[1] { '.' });
			if (array.Length == 0)
			{
				return;
			}
			Node value = root;
			string[] array2 = array;
			foreach (string key in array2)
			{
				if (value != root && value.Children.Count == 0)
				{
					output.AddFieldPath(path);
					return;
				}
				if (!value.Children.TryGetValue(key, out value))
				{
					return;
				}
			}
			List<string> list = new List<string>();
			GetFieldPaths(value, path, list);
			foreach (string item in list)
			{
				output.AddFieldPath(item);
			}
		}

		public void Merge(IMessage source, IMessage destination, FieldMask.MergeOptions options)
		{
			if (source.Descriptor != destination.Descriptor)
			{
				throw new InvalidProtocolBufferException("Cannot merge messages of different types.");
			}
			if (root.Children.Count != 0)
			{
				Merge(root, "", source, destination, options);
			}
		}

		private void Merge(Node node, string path, IMessage source, IMessage destination, FieldMask.MergeOptions options)
		{
			if (source.Descriptor != destination.Descriptor)
			{
				throw new InvalidProtocolBufferException($"source ({source.Descriptor}) and destination ({destination.Descriptor}) descriptor must be equal");
			}
			MessageDescriptor descriptor = source.Descriptor;
			foreach (KeyValuePair<string, Node> child in node.Children)
			{
				FieldDescriptor fieldDescriptor = descriptor.FindFieldByName(child.Key);
				if (fieldDescriptor == null)
				{
					continue;
				}
				if (child.Value.Children.Count != 0)
				{
					if (fieldDescriptor.IsRepeated || fieldDescriptor.FieldType != FieldType.Message)
					{
						continue;
					}
					object value = fieldDescriptor.Accessor.GetValue(source);
					object obj = fieldDescriptor.Accessor.GetValue(destination);
					if (value != null || obj != null)
					{
						if (obj == null)
						{
							obj = fieldDescriptor.MessageType.Parser.CreateTemplate();
							fieldDescriptor.Accessor.SetValue(destination, obj);
						}
						string path2 = ((path.Length == 0) ? child.Key : (path + "." + child.Key));
						Merge(child.Value, path2, (IMessage)value, (IMessage)obj, options);
					}
					continue;
				}
				if (fieldDescriptor.IsRepeated)
				{
					if (options.ReplaceRepeatedFields)
					{
						fieldDescriptor.Accessor.Clear(destination);
					}
					IList obj2 = (IList)fieldDescriptor.Accessor.GetValue(source);
					IList list = (IList)fieldDescriptor.Accessor.GetValue(destination);
					foreach (object item in obj2)
					{
						list.Add(item);
					}
					continue;
				}
				object value2 = fieldDescriptor.Accessor.GetValue(source);
				if (fieldDescriptor.FieldType == FieldType.Message)
				{
					if (options.ReplaceMessageFields)
					{
						if (value2 == null)
						{
							fieldDescriptor.Accessor.Clear(destination);
						}
						else
						{
							fieldDescriptor.Accessor.SetValue(destination, value2);
						}
					}
					else
					{
						if (value2 == null)
						{
							continue;
						}
						if (fieldDescriptor.MessageType.IsWrapperType)
						{
							fieldDescriptor.Accessor.SetValue(destination, value2);
							continue;
						}
						ByteString data = ((IMessage)value2).ToByteString();
						IMessage message = (IMessage)fieldDescriptor.Accessor.GetValue(destination);
						if (message != null)
						{
							message.MergeFrom(data);
						}
						else
						{
							fieldDescriptor.Accessor.SetValue(destination, fieldDescriptor.MessageType.Parser.ParseFrom(data));
						}
					}
				}
				else if (value2 != null || !options.ReplacePrimitiveFields)
				{
					fieldDescriptor.Accessor.SetValue(destination, value2);
				}
				else
				{
					fieldDescriptor.Accessor.Clear(destination);
				}
			}
		}
	}
	internal static class FrameworkPortability
	{
		internal static readonly RegexOptions CompiledRegexWhereAvailable = (System.Enum.IsDefined(typeof(RegexOptions), 8) ? RegexOptions.Compiled : RegexOptions.None);
	}
	public interface IBufferMessage : IMessage
	{
		void InternalMergeFrom(ref ParseContext ctx);

		void InternalWriteTo(ref WriteContext ctx);
	}
	public interface ICustomDiagnosticMessage : IMessage
	{
		string ToDiagnosticString();
	}
	public interface IDeepCloneable<T>
	{
		T Clone();
	}
	public interface IExtendableMessage<T> : IMessage<T>, IMessage, IEquatable<T>, IDeepCloneable<T> where T : IExtendableMessage<T>
	{
		TValue GetExtension<TValue>(Extension<T, TValue> extension);

		RepeatedField<TValue> GetExtension<TValue>(RepeatedExtension<T, TValue> extension);

		RepeatedField<TValue> GetOrInitializeExtension<TValue>(RepeatedExtension<T, TValue> extension);

		void SetExtension<TValue>(Extension<T, TValue> extension, TValue value);

		bool HasExtension<TValue>(Extension<T, TValue> extension);

		void ClearExtension<TValue>(Extension<T, TValue> extension);

		void ClearExtension<TValue>(RepeatedExtension<T, TValue> extension);
	}
	public interface IMessage
	{
		MessageDescriptor Descriptor { get; }

		void MergeFrom(CodedInputStream input);

		void WriteTo(CodedOutputStream output);

		int CalculateSize();
	}
	public interface IMessage<T> : IMessage, IEquatable<T>, IDeepCloneable<T> where T : IMessage<T>
	{
		void MergeFrom(T message);
	}
	public sealed class InvalidJsonException : IOException
	{
		internal InvalidJsonException(string message)
			: base(message)
		{
		}
	}
	public sealed class InvalidProtocolBufferException : IOException
	{
		internal InvalidProtocolBufferException(string message)
			: base(message)
		{
		}

		internal InvalidProtocolBufferException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		internal static InvalidProtocolBufferException MoreDataAvailable()
		{
			return new InvalidProtocolBufferException("Completed reading a message while more data was available in the stream.");
		}

		internal static InvalidProtocolBufferException TruncatedMessage()
		{
			return new InvalidProtocolBufferException("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
		}

		internal static InvalidProtocolBufferException NegativeSize()
		{
			return new InvalidProtocolBufferException("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
		}

		internal static InvalidProtocolBufferException MalformedVarint()
		{
			return new InvalidProtocolBufferException("CodedInputStream encountered a malformed varint.");
		}

		internal static InvalidProtocolBufferException InvalidTag()
		{
			return new InvalidProtocolBufferException("Protocol message contained an invalid tag (zero).");
		}

		internal static InvalidProtocolBufferException InvalidWireType()
		{
			return new InvalidProtocolBufferException("Protocol message contained a tag with an invalid wire type.");
		}

		internal static InvalidProtocolBufferException InvalidBase64(Exception innerException)
		{
			return new InvalidProtocolBufferException("Invalid base64 data", innerException);
		}

		internal static InvalidProtocolBufferException InvalidEndTag()
		{
			return new InvalidProtocolBufferException("Protocol message end-group tag did not match expected tag.");
		}

		internal static InvalidProtocolBufferException RecursionLimitExceeded()
		{
			return new InvalidProtocolBufferException("Protocol message had too many levels of nesting.  May be malicious.  Use CodedInputStream.SetRecursionLimit() to increase the depth limit.");
		}

		internal static InvalidProtocolBufferException JsonRecursionLimitExceeded()
		{
			return new InvalidProtocolBufferException("Protocol message had too many levels of nesting.  May be malicious.  Use JsonParser.Settings to increase the depth limit.");
		}

		internal static InvalidProtocolBufferException SizeLimitExceeded()
		{
			return new InvalidProtocolBufferException("Protocol message was too large.  May be malicious.  Use CodedInputStream.SetSizeLimit() to increase the size limit.");
		}

		internal static InvalidProtocolBufferException InvalidMessageStreamTag()
		{
			return new InvalidProtocolBufferException("Stream of protocol messages had invalid tag. Expected tag is length-delimited field 1.");
		}

		internal static InvalidProtocolBufferException MissingFields()
		{
			return new InvalidProtocolBufferException("Message was missing required fields");
		}
	}
	public sealed class JsonFormatter
	{
		public sealed class Settings
		{
			public static Settings Default { get; }

			public bool FormatDefaultValues { get; }

			public TypeRegistry TypeRegistry { get; }

			public bool FormatEnumsAsIntegers { get; }

			public bool PreserveProtoFieldNames { get; }

			public string Indentation { get; }

			static Settings()
			{
				Default = new Settings(formatDefaultValues: false);
			}

			public Settings(bool formatDefaultValues)
				: this(formatDefaultValues, TypeRegistry.Empty)
			{
			}

			public Settings(bool formatDefaultValues, TypeRegistry typeRegistry)
				: this(formatDefaultValues, typeRegistry, formatEnumsAsIntegers: false, preserveProtoFieldNames: false)
			{
			}

			private Settings(bool formatDefaultValues, TypeRegistry typeRegistry, bool formatEnumsAsIntegers, bool preserveProtoFieldNames, string indentation = null)
			{
				FormatDefaultValues = formatDefaultValues;
				TypeRegistry = typeRegistry ?? TypeRegistry.Empty;
				FormatEnumsAsIntegers = formatEnumsAsIntegers;
				PreserveProtoFieldNames = preserveProtoFieldNames;
				Indentation = indentation;
			}

			public Settings WithFormatDefaultValues(bool formatDefaultValues)
			{
				return new Settings(formatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, Indentation);
			}

			public Settings WithTypeRegistry(TypeRegistry typeRegistry)
			{
				return new Settings(FormatDefaultValues, typeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, Indentation);
			}

			public Settings WithFormatEnumsAsIntegers(bool formatEnumsAsIntegers)
			{
				return new Settings(FormatDefaultValues, TypeRegistry, formatEnumsAsIntegers, PreserveProtoFieldNames, Indentation);
			}

			public Settings WithPreserveProtoFieldNames(bool preserveProtoFieldNames)
			{
				return new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, preserveProtoFieldNames, Indentation);
			}

			public Settings WithIndentation(string indentation = "  ")
			{
				return new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, indentation);
			}
		}

		private static class OriginalEnumValueHelper
		{
			private static readonly ConcurrentDictionary<System.Type, Dictionary<object, string>> dictionaries = new ConcurrentDictionary<System.Type, Dictionary<object, string>>();

			[UnconditionalSuppressMessage("Trimming", "IL2072", Justification = "The field for the value must still be present. It will be returned by reflection, will be in this collection, and its name can be resolved.")]
			internal static string GetOriginalName(object value)
			{
				dictionaries.GetOrAdd(value.GetType(), (System.Type t) => GetNameMapping(t)).TryGetValue(value, out var value2);
				return value2;
			}

			private static Dictionary<object, string> GetNameMapping([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] System.Type enumType)
			{
				return (from f in enumType.GetTypeInfo().DeclaredFields
					where f.IsStatic
					where f.GetCustomAttributes<OriginalNameAttribute>().FirstOrDefault()?.PreferredAlias ?? true
					select f).ToDictionary((FieldInfo f) => f.GetValue(null), (FieldInfo f) => f.GetCustomAttributes<OriginalNameAttribute>().FirstOrDefault()?.Name ?? f.Name);
			}
		}

		internal const string AnyTypeUrlField = "@type";

		internal const string AnyDiagnosticValueField = "@value";

		internal const string AnyWellKnownTypeValueField = "value";

		private const string NameValueSeparator = ": ";

		private const string ValueSeparator = ", ";

		private const string MultilineValueSeparator = ",";

		private const char ObjectOpenBracket = '{';

		private const char ObjectCloseBracket = '}';

		private const char ListBracketOpen = '[';

		private const char ListBracketClose = ']';

		private static readonly JsonFormatter diagnosticFormatter;

		private static readonly string[] CommonRepresentations;

		private readonly Settings settings;

		private const string Hex = "0123456789abcdef";

		public static JsonFormatter Default { get; }

		private bool DiagnosticOnly => this == diagnosticFormatter;

		static JsonFormatter()
		{
			Default = new JsonFormatter(Settings.Default);
			diagnosticFormatter = new JsonFormatter(Settings.Default);
			CommonRepresentations = new string[160]
			{
				"\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t",
				"\\n", "\\u000b", "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013",
				"\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d",
				"\\u001e", "\\u001f", "", "", "\\\"", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"\\u003c", "", "\\u003e", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"", "", "\\\\", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "", "", "",
				"", "", "", "", "", "", "", "\\u007f", "\\u0080", "\\u0081",
				"\\u0082", "\\u0083", "\\u0084", "\\u0085", "\\u0086", "\\u0087", "\\u0088", "\\u0089", "\\u008a", "\\u008b",
				"\\u008c", "\\u008d", "\\u008e", "\\u008f", "\\u0090", "\\u0091", "\\u0092", "\\u0093", "\\u0094", "\\u0095",
				"\\u0096", "\\u0097", "\\u0098", "\\u0099", "\\u009a", "\\u009b", "\\u009c", "\\u009d", "\\u009e", "\\u009f"
			};
			for (int i = 0; i < CommonRepresentations.Length; i++)
			{
				if (CommonRepresentations[i] == "")
				{
					CommonRepresentations[i] = ((char)i).ToString();
				}
			}
		}

		public JsonFormatter(Settings settings)
		{
			this.settings = ProtoPreconditions.CheckNotNull(settings, "settings");
		}

		public string Format(IMessage message)
		{
			return Format(message, 0);
		}

		public string Format(IMessage message, int indentationLevel)
		{
			StringWriter stringWriter = new StringWriter();
			Format(message, stringWriter, indentationLevel);
			return stringWriter.ToString();
		}

		public void Format(IMessage message, TextWriter writer)
		{
			Format(message, writer, 0);
		}

		public void Format(IMessage message, TextWriter writer, int indentationLevel)
		{
			ProtoPreconditions.CheckNotNull(message, "message");
			ProtoPreconditions.CheckNotNull(writer, "writer");
			if (message.Descriptor.IsWellKnownType)
			{
				WriteWellKnownTypeValue(writer, message.Descriptor, message, indentationLevel);
			}
			else
			{
				WriteMessage(writer, message, indentationLevel);
			}
		}

		public static string ToDiagnosticString(IMessage message)
		{
			ProtoPreconditions.CheckNotNull(message, "message");
			return diagnosticFormatter.Format(message);
		}

		private void WriteMessage(TextWriter writer, IMessage message, int indentationLevel)
		{
			if (message == null)
			{
				WriteNull(writer);
				return;
			}
			if (DiagnosticOnly && message is ICustomDiagnosticMessage customDiagnosticMessage)
			{
				writer.Write(customDiagnosticMessage.ToDiagnosticString());
				return;
			}
			WriteBracketOpen(writer, '{');
			bool hasFields = WriteMessageFields(writer, message, assumeFirstFieldWritten: false, indentationLevel + 1);
			WriteBracketClose(writer, '}', hasFields, indentationLevel);
		}

		private bool WriteMessageFields(TextWriter writer, IMessage message, bool assumeFirstFieldWritten, int indentationLevel)
		{
			MessageDescriptor.FieldCollection fields = message.Descriptor.Fields;
			bool flag = !assumeFirstFieldWritten;
			foreach (FieldDescriptor item in fields.InFieldNumberOrder())
			{
				IFieldAccessor accessor = item.Accessor;
				object value = accessor.GetValue(message);
				if (ShouldFormatFieldValue(message, item, value))
				{
					MaybeWriteValueSeparator(writer, flag);
					MaybeWriteValueWhitespace(writer, indentationLevel);
					if (settings.PreserveProtoFieldNames)
					{
						WriteString(writer, accessor.Descriptor.Name);
					}
					else
					{
						WriteString(writer, accessor.Descriptor.JsonName);
					}
					writer.Write(": ");
					WriteValue(writer, value, indentationLevel);
					flag = false;
				}
			}
			return !flag;
		}

		private void MaybeWriteValueSeparator(TextWriter writer, bool first)
		{
			if (!first)
			{
				writer.Write((settings.Indentation == null) ? ", " : ",");
			}
		}

		private bool ShouldFormatFieldValue(IMessage message, FieldDescriptor field, object value)
		{
			if (!field.HasPresence)
			{
				if (!settings.FormatDefaultValues)
				{
					return !IsDefaultValue(field, value);
				}
				return true;
			}
			return field.Accessor.HasValue(message);
		}

		internal static string ToJsonName(string name)
		{
			StringBuilder stringBuilder = new StringBuilder(name.Length);
			bool flag = false;
			foreach (char c in name)
			{
				if (c == '_')
				{
					flag = true;
				}
				else if (flag)
				{
					stringBuilder.Append(char.ToUpperInvariant(c));
					flag = false;
				}
				else
				{
					stringBuilder.Append(c);
				}
			}
			return stringBuilder.ToString();
		}

		internal static string FromJsonName(string name)
		{
			StringBuilder stringBuilder = new StringBuilder(name.Length);
			foreach (char c in name)
			{
				if (char.IsUpper(c))
				{
					stringBuilder.Append('_');
					stringBuilder.Append(char.ToLowerInvariant(c));
				}
				else
				{
					stringBuilder.Append(c);
				}
			}
			return stringBuilder.ToString();
		}

		private static void WriteNull(TextWriter writer)
		{
			writer.Write("null");
		}

		private static bool IsDefaultValue(FieldDescriptor descriptor, object value)
		{
			if (descriptor.IsMap)
			{
				return ((IDictionary)value).Count == 0;
			}
			if (descriptor.IsRepeated)
			{
				return ((IList)value).Count == 0;
			}
			switch (descriptor.FieldType)
			{
			case FieldType.Bool:
				return !(bool)value;
			case FieldType.Bytes:
				return (ByteString)value == ByteString.Empty;
			case FieldType.String:
				return (string)value == "";
			case FieldType.Double:
				return (double)value == 0.0;
			case FieldType.Int32:
			case FieldType.SFixed32:
			case FieldType.SInt32:
			case FieldType.Enum:
				return (int)value == 0;
			case FieldType.Fixed32:
			case FieldType.UInt32:
				return (uint)value == 0;
			case FieldType.UInt64:
			case FieldType.Fixed64:
				return (ulong)value == 0;
			case FieldType.Int64:
			case FieldType.SFixed64:
			case FieldType.SInt64:
				return (long)value == 0;
			case FieldType.Float:
				return (float)value == 0f;
			case FieldType.Group:
			case FieldType.Message:
				return value == null;
			default:
				throw new ArgumentException("Invalid field type");
			}
		}

		public void WriteValue(TextWriter writer, object value)
		{
			WriteValue(writer, value, 0);
		}

		public void WriteValue(TextWriter writer, object value, int indentationLevel)
		{
			if (value == null || value is NullValue)
			{
				WriteNull(writer);
			}
			else if (value is bool flag)
			{
				writer.Write(flag ? "true" : "false");
			}
			else if (value is ByteString byteString)
			{
				writer.Write('"');
				writer.Write(byteString.ToBase64());
				writer.Write('"');
			}
			else if (value is string text)
			{
				WriteString(writer, text);
			}
			else if (value is IDictionary dictionary)
			{
				WriteDictionary(writer, dictionary, indentationLevel);
			}
			else if (value is IList list)
			{
				WriteList(writer, list, indentationLevel);
			}
			else if (value is int || value is uint)
			{
				IFormattable formattable = (IFormattable)value;
				writer.Write(formattable.ToString("d", CultureInfo.InvariantCulture));
			}
			else if (value is long || value is ulong)
			{
				writer.Write('"');
				IFormattable formattable2 = (IFormattable)value;
				writer.Write(formattable2.ToString("d", CultureInfo.InvariantCulture));
				writer.Write('"');
			}
			else if (value is System.Enum)
			{
				if (settings.FormatEnumsAsIntegers)
				{
					WriteValue(writer, (int)value);
					return;
				}
				string originalName = OriginalEnumValueHelper.GetOriginalName(value);
				if (originalName != null)
				{
					WriteString(writer, originalName);
				}
				else
				{
					WriteValue(writer, (int)value);
				}
			}
			else if (value is float || value is double)
			{
				string text2 = ((IFormattable)value).ToString("r", CultureInfo.InvariantCulture);
				switch (text2)
				{
				case "NaN":
				case "Infinity":
				case "-Infinity":
					writer.Write('"');
					writer.Write(text2);
					writer.Write('"');
					break;
				default:
					writer.Write(text2);
					break;
				}
			}
			else
			{
				if (!(value is IMessage message))
				{
					throw new ArgumentException("Unable to format value of type " + value.GetType());
				}
				Format(message, writer, indentationLevel);
			}
		}

		private void WriteWellKnownTypeValue(TextWriter writer, MessageDescriptor descriptor, object value, int indentationLevel)
		{
			if (value == null)
			{
				WriteNull(writer);
			}
			else if (descriptor.IsWrapperType)
			{
				if (value is IMessage message)
				{
					value = message.Descriptor.Fields[1].Accessor.GetValue(message);
				}
				WriteValue(writer, value);
			}
			else if (descriptor.FullName == Timestamp.Descriptor.FullName)
			{
				WriteTimestamp(writer, (IMessage)value);
			}
			else if (descriptor.FullName == Duration.Descriptor.FullName)
			{
				WriteDuration(writer, (IMessage)value);
			}
			else if (descriptor.FullName == FieldMask.Descriptor.FullName)
			{
				WriteFieldMask(writer, (IMessage)value);
			}
			else if (descriptor.FullName == Struct.Descriptor.FullName)
			{
				WriteStruct(writer, (IMessage)value, indentationLevel);
			}
			else if (descriptor.FullName == ListValue.Descriptor.FullName)
			{
				IFieldAccessor accessor = descriptor.Fields[1].Accessor;
				WriteList(writer, (IList)accessor.GetValue((IMessage)value), indentationLevel);
			}
			else if (descriptor.FullName == Value.Descriptor.FullName)
			{
				WriteStructFieldValue(writer, (IMessage)value, indentationLevel);
			}
			else if (descriptor.FullName == Any.Descriptor.FullName)
			{
				WriteAny(writer, (IMessage)value, indentationLevel);
			}
			else
			{
				WriteMessage(writer, (IMessage)value, indentationLevel);
			}
		}

		private void WriteTimestamp(TextWriter writer, IMessage value)
		{
			int nanoseconds = (int)value.Descriptor.Fields[2].Accessor.GetValue(value);
			long seconds = (long)value.Descriptor.Fields[1].Accessor.GetValue(value);
			writer.Write(Timestamp.ToJson(seconds, nanoseconds, DiagnosticOnly));
		}

		private void WriteDuration(TextWriter writer, IMessage value)
		{
			int nanoseconds = (int)value.Descriptor.Fields[2].Accessor.GetValue(value);
			long seconds = (long)value.Descriptor.Fields[1].Accessor.GetValue(value);
			writer.Write(Duration.ToJson(seconds, nanoseconds, DiagnosticOnly));
		}

		private void WriteFieldMask(TextWriter writer, IMessage value)
		{
			IList<string> paths = (IList<string>)value.Descriptor.Fields[1].Accessor.GetValue(value);
			writer.Write(FieldMask.ToJson(paths, DiagnosticOnly));
		}

		private void WriteAny(TextWriter writer, IMessage value, int indentationLevel)
		{
			if (DiagnosticOnly)
			{
				WriteDiagnosticOnlyAny(writer, value);
				return;
			}
			string text = (string)value.Descriptor.Fields[1].Accessor.GetValue(value);
			ByteString data = (ByteString)value.Descriptor.Fields[2].Accessor.GetValue(value);
			string typeName = Any.GetTypeName(text);
			MessageDescriptor messageDescriptor = settings.TypeRegistry.Find(typeName);
			if (messageDescriptor == null)
			{
				throw new InvalidOperationException("Type registry has no descriptor for type name '" + typeName + "'");
			}
			IMessage message = messageDescriptor.Parser.ParseFrom(data);
			WriteBracketOpen(writer, '{');
			WriteString(writer, "@type");
			writer.Write(": ");
			WriteString(writer, text);
			if (messageDescriptor.IsWellKnownType)
			{
				writer.Write(", ");
				WriteString(writer, "value");
				writer.Write(": ");
				WriteWellKnownTypeValue(writer, messageDescriptor, message, indentationLevel);
			}
			else
			{
				WriteMessageFields(writer, message, assumeFirstFieldWritten: true, indentationLevel);
			}
			WriteBracketClose(writer, '}', hasFields: true, indentationLevel);
		}

		private void WriteDiagnosticOnlyAny(TextWriter writer, IMessage value)
		{
			string text = (string)value.Descriptor.Fields[1].Accessor.GetValue(value);
			ByteString byteString = (ByteString)value.Descriptor.Fields[2].Accessor.GetValue(value);
			writer.Write("{ ");
			WriteString(writer, "@type");
			writer.Write(": ");
			WriteString(writer, text);
			writer.Write(", ");
			WriteString(writer, "@value");
			writer.Write(": ");
			writer.Write('"');
			writer.Write(byteString.ToBase64());
			writer.Write('"');
			writer.Write(" }");
		}

		private void WriteStruct(TextWriter writer, IMessage message, int indentationLevel)
		{
			WriteBracketOpen(writer, '{');
			IDictionary obj = (IDictionary)message.Descriptor.Fields[1].Accessor.GetValue(message);
			bool flag = true;
			foreach (DictionaryEntry item in obj)
			{
				string text = (string)item.Key;
				IMessage message2 = (IMessage)item.Value;
				if (string.IsNullOrEmpty(text) || message2 == null)
				{
					throw new InvalidOperationException("Struct fields cannot have an empty key or a null value.");
				}
				MaybeWriteValueSeparator(writer, flag);
				MaybeWriteValueWhitespace(writer, indentationLevel + 1);
				WriteString(writer, text);
				writer.Write(": ");
				WriteStructFieldValue(writer, message2, indentationLevel + 1);
				flag = false;
			}
			WriteBracketClose(writer, '}', !flag, indentationLevel);
		}

		private void WriteStructFieldValue(TextWriter writer, IMessage message, int indentationLevel)
		{
			FieldDescriptor caseFieldDescriptor = message.Descriptor.Oneofs[0].Accessor.GetCaseFieldDescriptor(message);
			if (caseFieldDescriptor == null)
			{
				throw new InvalidOperationException("Value message must contain a value for the oneof.");
			}
			object value = caseFieldDescriptor.Accessor.GetValue(message);
			switch (caseFieldDescriptor.FieldNumber)
			{
			case 2:
			case 3:
			case 4:
				WriteValue(writer, value);
				break;
			case 5:
			case 6:
			{
				IMessage message2 = (IMessage)caseFieldDescriptor.Accessor.GetValue(message);
				WriteWellKnownTypeValue(writer, message2.Descriptor, message2, indentationLevel);
				break;
			}
			case 1:
				WriteNull(writer);
				break;
			default:
				throw new InvalidOperationException("Unexpected case in struct field: " + caseFieldDescriptor.FieldNumber);
			}
		}

		internal void WriteList(TextWriter writer, IList list, int indentationLevel = 0)
		{
			WriteBracketOpen(writer, '[');
			bool flag = true;
			foreach (object item in list)
			{
				MaybeWriteValueSeparator(writer, flag);
				MaybeWriteValueWhitespace(writer, indentationLevel + 1);
				WriteValue(writer, item, indentationLevel + 1);
				flag = false;
			}
			WriteBracketClose(writer, ']', !flag, indentationLevel);
		}

		internal void WriteDictionary(TextWriter writer, IDictionary dictionary, int indentationLevel = 0)
		{
			WriteBracketOpen(writer, '{');
			bool flag = true;
			foreach (DictionaryEntry item in dictionary)
			{
				string text2;
				if (item.Key is string text)
				{
					text2 = text;
				}
				else
				{
					object key = item.Key;
					if (key is bool)
					{
						text2 = (((bool)key) ? "true" : "false");
					}
					else
					{
						if (!(item.Key is int) && !(item.Key is uint) && !(item.Key is long) && !(item.Key is ulong))
						{
							if (item.Key == null)
							{
								throw new ArgumentException("Dictionary has entry with null key");
							}
							throw new ArgumentException("Unhandled dictionary key type: " + item.Key.GetType());
						}
						text2 = ((IFormattable)item.Key).ToString("d", CultureInfo.InvariantCulture);
					}
				}
				MaybeWriteValueSeparator(writer, flag);
				MaybeWriteValueWhitespace(writer, indentationLevel + 1);
				WriteString(writer, text2);
				writer.Write(": ");
				WriteValue(writer, item.Value);
				flag = false;
			}
			WriteBracketClose(writer, '}', !flag, indentationLevel);
		}

		internal static void WriteString(TextWriter writer, string text)
		{
			writer.Write('"');
			for (int i = 0; i < text.Length; i++)
			{
				char c = text[i];
				if (c < '\u00a0')
				{
					writer.Write(CommonRepresentations[(uint)c]);
					continue;
				}
				if (char.IsHighSurrogate(c))
				{
					i++;
					if (i == text.Length || !char.IsLowSurrogate(text[i]))
					{
						throw new ArgumentException("String contains low surrogate not followed by high surrogate");
					}
					HexEncodeUtf16CodeUnit(writer, c);
					HexEncodeUtf16CodeUnit(writer, text[i]);
					continue;
				}
				if (char.IsLowSurrogate(c))
				{
					throw new ArgumentException("String contains high surrogate not preceded by low surrogate");
				}
				switch (c)
				{
				case '\u00ad':
				case '\u06dd':
				case '\u070f':
				case '\u17b4':
				case '\u17b5':
				case '\ufeff':
				case '\ufff9':
				case '\ufffa':
				case '\ufffb':
					HexEncodeUtf16CodeUnit(writer, c);
					continue;
				}
				if ((c >= '\u0600' && c <= '\u0603') || (c >= '\u200b' && c <= '\u200f') || (c >= '\u2028' && c <= '\u202e') || (c >= '\u2060' && c <= '\u2064') || (c >= '\u206a' && c <= '\u206f'))
				{
					HexEncodeUtf16CodeUnit(writer, c);
				}
				else
				{
					writer.Write(c);
				}
			}
			writer.Write('"');
		}

		private static void HexEncodeUtf16CodeUnit(TextWriter writer, char c)
		{
			writer.Write("\\u");
			writer.Write("0123456789abcdef"[((int)c >> 12) & 0xF]);
			writer.Write("0123456789abcdef"[((int)c >> 8) & 0xF]);
			writer.Write("0123456789abcdef"[((int)c >> 4) & 0xF]);
			writer.Write("0123456789abcdef"[c & 0xF]);
		}

		private void WriteBracketOpen(TextWriter writer, char openChar)
		{
			writer.Write(openChar);
			if (settings.Indentation == null)
			{
				writer.Write(' ');
			}
		}

		private void WriteBracketClose(TextWriter writer, char closeChar, bool hasFields, int indentationLevel)
		{
			if (hasFields)
			{
				if (settings.Indentation != null)
				{
					writer.WriteLine();
					WriteIndentation(writer, indentationLevel);
				}
				else
				{
					writer.Write(" ");
				}
			}
			writer.Write(closeChar);
		}

		private void MaybeWriteValueWhitespace(TextWriter writer, int indentationLevel)
		{
			if (settings.Indentation != null)
			{
				writer.WriteLine();
				WriteIndentation(writer, indentationLevel);
			}
		}

		private void WriteIndentation(TextWriter writer, int indentationLevel)
		{
			for (int i = 0; i < indentationLevel; i++)
			{
				writer.Write(settings.Indentation);
			}
		}
	}
	public sealed class JsonParser
	{
		public sealed class Settings
		{
			public static Settings Default { get; }

			public int RecursionLimit { get; }

			public TypeRegistry TypeRegistry { get; }

			public bool IgnoreUnknownFields { get; }

			static Settings()
			{
				Default = new Settings(100);
			}

			private Settings(int recursionLimit, TypeRegistry typeRegistry, bool ignoreUnknownFields)
			{
				RecursionLimit = recursionLimit;
				TypeRegistry = ProtoPreconditions.CheckNotNull(typeRegistry, "typeRegistry");
				IgnoreUnknownFields = ignoreUnknownFields;
			}

			public Settings(int recursionLimit)
				: this(recursionLimit, TypeRegistry.Empty)
			{
			}

			public Settings(int recursionLimit, TypeRegistry typeRegistry)
				: this(recursionLimit, typeRegistry, ignoreUnknownFields: false)
			{
			}

			public Settings WithIgnoreUnknownFields(bool ignoreUnknownFields)
			{
				return new Settings(RecursionLimit, TypeRegistry, ignoreUnknownFields);
			}

			public Settings WithRecursionLimit(int recursionLimit)
			{
				return new Settings(recursionLimit, TypeRegistry, IgnoreUnknownFields);
			}

			public Settings WithTypeRegistry(TypeRegistry typeRegistry)
			{
				return new Settings(RecursionLimit, ProtoPreconditions.CheckNotNull(typeRegistry, "typeRegistry"), IgnoreUnknownFields);
			}
		}

		private static readonly Regex TimestampRegex = new Regex("^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", FrameworkPortability.CompiledRegexWhereAvailable);

		private static readonly Regex DurationRegex = new Regex("^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\\.[0-9]{1,9})?s$", FrameworkPortability.CompiledRegexWhereAvailable);

		private static readonly int[] SubsecondScalingFactors = new int[11]
		{
			0, 100000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10,
			1
		};

		private static readonly char[] FieldMaskPathSeparators = new char[1] { ',' };

		private static readonly EnumDescriptor NullValueDescriptor = StructReflection.Descriptor.EnumTypes.Single((EnumDescriptor ed) => ed.ClrType == typeof(NullValue));

		private static readonly JsonParser defaultInstance = new JsonParser(Settings.Default);

		private static readonly Dictionary<string, Action<JsonParser, IMessage, JsonTokenizer>> WellKnownTypeHandlers = new Dictionary<string, Action<JsonParser, IMessage, JsonTokenizer>>
		{
			{
				Timestamp.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					MergeTimestamp(message, tokenizer.Next());
				}
			},
			{
				Duration.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					MergeDuration(message, tokenizer.Next());
				}
			},
			{
				Value.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					parser.MergeStructValue(message, tokenizer);
				}
			},
			{
				ListValue.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					parser.MergeRepeatedField(message, message.Descriptor.Fields[1], tokenizer);
				}
			},
			{
				Struct.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					parser.MergeStruct(message, tokenizer);
				}
			},
			{
				Any.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					parser.MergeAny(message, tokenizer);
				}
			},
			{
				FieldMask.Descriptor.FullName,
				delegate(JsonParser parser, IMessage message, JsonTokenizer tokenizer)
				{
					MergeFieldMask(message, tokenizer.Next());
				}
			},
			{
				Int32Value.Descriptor.FullName,
				MergeWrapperField
			},
			{
				Int64Value.Descriptor.FullName,
				MergeWrapperField
			},
			{
				UInt32Value.Descriptor.FullName,
				MergeWrapperField
			},
			{
				UInt64Value.Descriptor.FullName,
				MergeWrapperField
			},
			{
				FloatValue.Descriptor.FullName,
				MergeWrapperField
			},
			{
				DoubleValue.Descriptor.FullName,
				MergeWrapperField
			},
			{
				BytesValue.Descriptor.FullName,
				MergeWrapperField
	

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Bcl.AsyncInterfaces.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Bcl.AsyncInterfaces")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides the IAsyncEnumerable<T> and IAsyncDisposable interfaces and helper types for .NET Standard 2.0. This package is not required starting with .NET Standard 2.1 and .NET Core 3.0.\r\n\r\nCommonly Used Types:\r\nSystem.IAsyncDisposable\r\nSystem.Collections.Generic.IAsyncEnumerable\r\nSystem.Collections.Generic.IAsyncEnumerator")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Bcl.AsyncInterfaces")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace System
{
	public interface IAsyncDisposable
	{
		ValueTask DisposeAsync();
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Collections.Generic
{
	public interface IAsyncEnumerable<out T>
	{
		IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken));
	}
	public interface IAsyncEnumerator<out T> : IAsyncDisposable
	{
		T Current { get; }

		ValueTask<bool> MoveNextAsync();
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[StructLayout(LayoutKind.Auto)]
	public struct AsyncIteratorMethodBuilder
	{
		private AsyncTaskMethodBuilder _methodBuilder;

		private object _id;

		internal object ObjectIdForDebugger => _id ?? Interlocked.CompareExchange(ref _id, new object(), null) ?? _id;

		public static AsyncIteratorMethodBuilder Create()
		{
			AsyncIteratorMethodBuilder result = default(AsyncIteratorMethodBuilder);
			result._methodBuilder = AsyncTaskMethodBuilder.Create();
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void MoveNext<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.Start(ref stateMachine);
		}

		public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.AwaitOnCompleted(ref awaiter, ref stateMachine);
		}

		public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
		}

		public void Complete()
		{
			_methodBuilder.SetResult();
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
	public sealed class AsyncIteratorStateMachineAttribute : StateMachineAttribute
	{
		public AsyncIteratorStateMachineAttribute(Type stateMachineType)
			: base(stateMachineType)
		{
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredAsyncDisposable
	{
		private readonly IAsyncDisposable _source;

		private readonly bool _continueOnCapturedContext;

		internal ConfiguredAsyncDisposable(IAsyncDisposable source, bool continueOnCapturedContext)
		{
			_source = source;
			_continueOnCapturedContext = continueOnCapturedContext;
		}

		public ConfiguredValueTaskAwaitable DisposeAsync()
		{
			return _source.DisposeAsync().ConfigureAwait(_continueOnCapturedContext);
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredCancelableAsyncEnumerable<T>
	{
		[StructLayout(LayoutKind.Auto)]
		public readonly struct Enumerator
		{
			private readonly IAsyncEnumerator<T> _enumerator;

			private readonly bool _continueOnCapturedContext;

			public T Current => _enumerator.Current;

			internal Enumerator(IAsyncEnumerator<T> enumerator, bool continueOnCapturedContext)
			{
				_enumerator = enumerator;
				_continueOnCapturedContext = continueOnCapturedContext;
			}

			public ConfiguredValueTaskAwaitable<bool> MoveNextAsync()
			{
				return _enumerator.MoveNextAsync().ConfigureAwait(_continueOnCapturedContext);
			}

			public ConfiguredValueTaskAwaitable DisposeAsync()
			{
				return _enumerator.DisposeAsync().ConfigureAwait(_continueOnCapturedContext);
			}
		}

		private readonly IAsyncEnumerable<T> _enumerable;

		private readonly CancellationToken _cancellationToken;

		private readonly bool _continueOnCapturedContext;

		internal ConfiguredCancelableAsyncEnumerable(IAsyncEnumerable<T> enumerable, bool continueOnCapturedContext, CancellationToken cancellationToken)
		{
			_enumerable = enumerable;
			_continueOnCapturedContext = continueOnCapturedContext;
			_cancellationToken = cancellationToken;
		}

		public ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(bool continueOnCapturedContext)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(_enumerable, continueOnCapturedContext, _cancellationToken);
		}

		public ConfiguredCancelableAsyncEnumerable<T> WithCancellation(CancellationToken cancellationToken)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(_enumerable, _continueOnCapturedContext, cancellationToken);
		}

		public Enumerator GetAsyncEnumerator()
		{
			return new Enumerator(_enumerable.GetAsyncEnumerator(_cancellationToken), _continueOnCapturedContext);
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	public sealed class EnumeratorCancellationAttribute : Attribute
	{
	}
}
namespace System.Threading.Tasks
{
	public static class TaskAsyncEnumerableExtensions
	{
		public static ConfiguredAsyncDisposable ConfigureAwait(this IAsyncDisposable source, bool continueOnCapturedContext)
		{
			return new ConfiguredAsyncDisposable(source, continueOnCapturedContext);
		}

		public static ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait<T>(this IAsyncEnumerable<T> source, bool continueOnCapturedContext)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(source, continueOnCapturedContext, default(CancellationToken));
		}

		public static ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this IAsyncEnumerable<T> source, CancellationToken cancellationToken)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(source, continueOnCapturedContext: true, cancellationToken);
		}
	}
}
namespace System.Threading.Tasks.Sources
{
	[StructLayout(LayoutKind.Auto)]
	public struct ManualResetValueTaskSourceCore<TResult>
	{
		private Action<object> _continuation;

		private object _continuationState;

		private ExecutionContext _executionContext;

		private object _capturedContext;

		private bool _completed;

		private TResult _result;

		private ExceptionDispatchInfo _error;

		private short _version;

		public bool RunContinuationsAsynchronously { get; set; }

		public short Version => _version;

		public void Reset()
		{
			_version++;
			_completed = false;
			_result = default(TResult);
			_error = null;
			_executionContext = null;
			_capturedContext = null;
			_continuation = null;
			_continuationState = null;
		}

		public void SetResult(TResult result)
		{
			_result = result;
			SignalCompletion();
		}

		public void SetException(Exception error)
		{
			_error = ExceptionDispatchInfo.Capture(error);
			SignalCompletion();
		}

		public ValueTaskSourceStatus GetStatus(short token)
		{
			ValidateToken(token);
			if (_continuation != null && _completed)
			{
				if (_error != null)
				{
					if (!(_error.SourceException is OperationCanceledException))
					{
						return ValueTaskSourceStatus.Faulted;
					}
					return ValueTaskSourceStatus.Canceled;
				}
				return ValueTaskSourceStatus.Succeeded;
			}
			return ValueTaskSourceStatus.Pending;
		}

		public TResult GetResult(short token)
		{
			ValidateToken(token);
			if (!_completed)
			{
				throw new InvalidOperationException();
			}
			_error?.Throw();
			return _result;
		}

		public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags)
		{
			if (continuation == null)
			{
				throw new ArgumentNullException("continuation");
			}
			ValidateToken(token);
			if ((flags & ValueTaskSourceOnCompletedFlags.FlowExecutionContext) != 0)
			{
				_executionContext = ExecutionContext.Capture();
			}
			if ((flags & ValueTaskSourceOnCompletedFlags.UseSchedulingContext) != 0)
			{
				SynchronizationContext current = SynchronizationContext.Current;
				if (current != null && current.GetType() != typeof(SynchronizationContext))
				{
					_capturedContext = current;
				}
				else
				{
					TaskScheduler current2 = TaskScheduler.Current;
					if (current2 != TaskScheduler.Default)
					{
						_capturedContext = current2;
					}
				}
			}
			object obj = _continuation;
			if (obj == null)
			{
				_continuationState = state;
				obj = Interlocked.CompareExchange(ref _continuation, continuation, null);
			}
			if (obj == null)
			{
				return;
			}
			if (obj != System.Threading.Tasks.Sources.ManualResetValueTaskSourceCoreShared.s_sentinel)
			{
				throw new InvalidOperationException();
			}
			object capturedContext = _capturedContext;
			if (capturedContext != null)
			{
				if (!(capturedContext is SynchronizationContext synchronizationContext))
				{
					if (capturedContext is TaskScheduler scheduler)
					{
						Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
					}
				}
				else
				{
					synchronizationContext.Post(delegate(object s)
					{
						Tuple<Action<object>, object> tuple = (Tuple<Action<object>, object>)s;
						tuple.Item1(tuple.Item2);
					}, Tuple.Create(continuation, state));
				}
			}
			else
			{
				Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
			}
		}

		private void ValidateToken(short token)
		{
			if (token != _version)
			{
				throw new InvalidOperationException();
			}
		}

		private void SignalCompletion()
		{
			if (_completed)
			{
				throw new InvalidOperationException();
			}
			_completed = true;
			if (_continuation == null && Interlocked.CompareExchange(ref _continuation, System.Threading.Tasks.Sources.ManualResetValueTaskSourceCoreShared.s_sentinel, null) == null)
			{
				return;
			}
			if (_executionContext != null)
			{
				ExecutionContext.Run(_executionContext, delegate(object s)
				{
					((ManualResetValueTaskSourceCore<TResult>)s).InvokeContinuation();
				}, this);
			}
			else
			{
				InvokeContinuation();
			}
		}

		private void InvokeContinuation()
		{
			object capturedContext = _capturedContext;
			if (capturedContext != null)
			{
				if (!(capturedContext is SynchronizationContext synchronizationContext))
				{
					if (capturedContext is TaskScheduler scheduler)
					{
						Task.Factory.StartNew(_continuation, _continuationState, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
					}
				}
				else
				{
					synchronizationContext.Post(delegate(object s)
					{
						Tuple<Action<object>, object> tuple = (Tuple<Action<object>, object>)s;
						tuple.Item1(tuple.Item2);
					}, Tuple.Create(_continuation, _continuationState));
				}
			}
			else if (RunContinuationsAsynchronously)
			{
				Task.Factory.StartNew(_continuation, _continuationState, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
			}
			else
			{
				_continuation(_continuationState);
			}
		}
	}
	internal static class ManualResetValueTaskSourceCoreShared
	{
		internal static readonly Action<object> s_sentinel = CompletionSentinel;

		private static void CompletionSentinel(object _)
		{
			throw new InvalidOperationException();
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.Abstractions.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using FxResources.Microsoft.Extensions.Configuration.Abstractions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Primitives;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.Abstractions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Abstractions of key-value pair based configuration.\r\n\r\nCommonly Used Types:\r\nMicrosoft.Extensions.Configuration.IConfiguration\r\nMicrosoft.Extensions.Configuration.IConfigurationBuilder\r\nMicrosoft.Extensions.Configuration.IConfigurationProvider\r\nMicrosoft.Extensions.Configuration.IConfigurationRoot\r\nMicrosoft.Extensions.Configuration.IConfigurationSection")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.Abstractions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string InvalidSectionName => GetResourceString("InvalidSectionName");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public readonly struct ConfigurationDebugViewContext
	{
		public string Path { get; }

		public string Key { get; }

		public string? Value { get; }

		public IConfigurationProvider ConfigurationProvider { get; }

		public ConfigurationDebugViewContext(string path, string key, string? value, IConfigurationProvider configurationProvider)
		{
			Path = path;
			Key = key;
			Value = value;
			ConfigurationProvider = configurationProvider;
		}
	}
	public static class ConfigurationExtensions
	{
		public static IConfigurationBuilder Add<TSource>(this IConfigurationBuilder builder, Action<TSource>? configureSource) where TSource : IConfigurationSource, new()
		{
			TSource val = new TSource();
			configureSource?.Invoke(val);
			return builder.Add(val);
		}

		public static string? GetConnectionString(this IConfiguration configuration, string name)
		{
			return configuration?.GetSection("ConnectionStrings")[name];
		}

		public static IEnumerable<KeyValuePair<string, string?>> AsEnumerable(this IConfiguration configuration)
		{
			return configuration.AsEnumerable(makePathsRelative: false);
		}

		public static IEnumerable<KeyValuePair<string, string?>> AsEnumerable(this IConfiguration configuration, bool makePathsRelative)
		{
			Stack<IConfiguration> stack = new Stack<IConfiguration>();
			stack.Push(configuration);
			int prefixLength = ((makePathsRelative && configuration is IConfigurationSection configurationSection) ? (configurationSection.Path.Length + 1) : 0);
			while (stack.Count > 0)
			{
				IConfiguration config = stack.Pop();
				if (config is IConfigurationSection configurationSection2 && (!makePathsRelative || config != configuration))
				{
					yield return new KeyValuePair<string, string>(configurationSection2.Path.Substring(prefixLength), configurationSection2.Value);
				}
				foreach (IConfigurationSection child in config.GetChildren())
				{
					stack.Push(child);
				}
			}
		}

		public static bool Exists([NotNullWhen(true)] this IConfigurationSection? section)
		{
			if (section == null)
			{
				return false;
			}
			if (section.Value == null)
			{
				return section.GetChildren().Any();
			}
			return true;
		}

		public static IConfigurationSection GetRequiredSection(this IConfiguration configuration, string key)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			IConfigurationSection section = configuration.GetSection(key);
			if (section.Exists())
			{
				return section;
			}
			throw new InvalidOperationException(System.SR.Format(System.SR.InvalidSectionName, key));
		}
	}
	[AttributeUsage(AttributeTargets.Property)]
	public sealed class ConfigurationKeyNameAttribute : Attribute
	{
		public string Name { get; }

		public ConfigurationKeyNameAttribute(string name)
		{
			Name = name;
		}
	}
	public static class ConfigurationPath
	{
		public static readonly string KeyDelimiter = ":";

		public static string Combine(params string[] pathSegments)
		{
			System.ThrowHelper.ThrowIfNull(pathSegments, "pathSegments");
			return string.Join(KeyDelimiter, pathSegments);
		}

		public static string Combine(IEnumerable<string> pathSegments)
		{
			System.ThrowHelper.ThrowIfNull(pathSegments, "pathSegments");
			return string.Join(KeyDelimiter, pathSegments);
		}

		[return: NotNullIfNotNull("path")]
		public static string? GetSectionKey(string? path)
		{
			if (string.IsNullOrEmpty(path))
			{
				return path;
			}
			int num = path.LastIndexOf(KeyDelimiter, StringComparison.OrdinalIgnoreCase);
			if (num != -1)
			{
				return path.Substring(num + 1);
			}
			return path;
		}

		public static string? GetParentPath(string? path)
		{
			if (string.IsNullOrEmpty(path))
			{
				return null;
			}
			int num = path.LastIndexOf(KeyDelimiter, StringComparison.OrdinalIgnoreCase);
			if (num != -1)
			{
				return path.Substring(0, num);
			}
			return null;
		}
	}
	public static class ConfigurationRootExtensions
	{
		public static string GetDebugView(this IConfigurationRoot root)
		{
			return root.GetDebugView(null);
		}

		public static string GetDebugView(this IConfigurationRoot root, Func<ConfigurationDebugViewContext, string>? processValue)
		{
			IConfigurationRoot root2 = root;
			Func<ConfigurationDebugViewContext, string> processValue2 = processValue;
			StringBuilder stringBuilder2 = new StringBuilder();
			RecurseChildren(stringBuilder2, root2.GetChildren(), "");
			return stringBuilder2.ToString();
			void RecurseChildren(StringBuilder stringBuilder, IEnumerable<IConfigurationSection> children, string indent)
			{
				foreach (IConfigurationSection child in children)
				{
					(string, IConfigurationProvider) valueAndProvider = GetValueAndProvider(root2, child.Path);
					if (valueAndProvider.Item2 != null)
					{
						string text;
						if (processValue2 == null)
						{
							(text, _) = valueAndProvider;
						}
						else
						{
							text = processValue2(new ConfigurationDebugViewContext(child.Key, child.Path, valueAndProvider.Item1, valueAndProvider.Item2));
						}
						string value = text;
						stringBuilder.Append(indent).Append(child.Key).Append('=')
							.Append(value)
							.Append(" (")
							.Append(valueAndProvider.Item2)
							.AppendLine(")");
					}
					else
					{
						stringBuilder.Append(indent).Append(child.Key).AppendLine(":");
					}
					RecurseChildren(stringBuilder, child.GetChildren(), indent + "  ");
				}
			}
		}

		private static (string Value, IConfigurationProvider Provider) GetValueAndProvider(IConfigurationRoot root, string key)
		{
			foreach (IConfigurationProvider item in root.Providers.Reverse())
			{
				if (item.TryGet(key, out string value))
				{
					return (value, item);
				}
			}
			return (null, null);
		}
	}
	public interface IConfiguration
	{
		string? this[string key] { get; set; }

		IConfigurationSection GetSection(string key);

		IEnumerable<IConfigurationSection> GetChildren();

		IChangeToken GetReloadToken();
	}
	public interface IConfigurationBuilder
	{
		IDictionary<string, object> Properties { get; }

		IList<IConfigurationSource> Sources { get; }

		IConfigurationBuilder Add(IConfigurationSource source);

		IConfigurationRoot Build();
	}
	public interface IConfigurationProvider
	{
		bool TryGet(string key, out string? value);

		void Set(string key, string? value);

		IChangeToken GetReloadToken();

		void Load();

		IEnumerable<string> GetChildKeys(IEnumerable<string> earlierKeys, string? parentPath);
	}
	public interface IConfigurationRoot : IConfiguration
	{
		IEnumerable<IConfigurationProvider> Providers { get; }

		void Reload();
	}
	public interface IConfigurationSection : IConfiguration
	{
		string Key { get; }

		string Path { get; }

		string? Value { get; set; }
	}
	public interface IConfigurationSource
	{
		IConfigurationProvider Build(IConfigurationBuilder builder);
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.Binder.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.Configuration.Binder;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Internal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Binder.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.Binder")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.323.6910")]
[assembly: AssemblyInformationalVersion("7.0.3+0a2bda10e81d901396c3cff95533529e3a93ad47")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.Binder")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.3")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.Binder
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_CannotActivateAbstractOrInterface => GetResourceString("Error_CannotActivateAbstractOrInterface");

		internal static string Error_CannotBindToConstructorParameter => GetResourceString("Error_CannotBindToConstructorParameter");

		internal static string Error_ConstructorParametersDoNotMatchProperties => GetResourceString("Error_ConstructorParametersDoNotMatchProperties");

		internal static string Error_FailedBinding => GetResourceString("Error_FailedBinding");

		internal static string Error_FailedToActivate => GetResourceString("Error_FailedToActivate");

		internal static string Error_MissingConfig => GetResourceString("Error_MissingConfig");

		internal static string Error_MissingPublicInstanceConstructor => GetResourceString("Error_MissingPublicInstanceConstructor");

		internal static string Error_MultipleParameterizedConstructors => GetResourceString("Error_MultipleParameterizedConstructors");

		internal static string Error_ParameterBeingBoundToIsUnnamed => GetResourceString("Error_ParameterBeingBoundToIsUnnamed");

		internal static string Error_ParameterHasNoMatchingConfig => GetResourceString("Error_ParameterHasNoMatchingConfig");

		internal static string Error_UnsupportedMultidimensionalArray => GetResourceString("Error_UnsupportedMultidimensionalArray");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresUnreferencedCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresUnreferencedCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string? Scope { get; set; }

		public string? Target { get; set; }

		public string? MessageId { get; set; }

		public string? Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Internal
{
	internal static class ParameterDefaultValue
	{
		public static bool TryGetDefaultValue(ParameterInfo parameter, out object? defaultValue)
		{
			bool tryToGetDefaultValue;
			bool flag = CheckHasDefaultValue(parameter, out tryToGetDefaultValue);
			defaultValue = null;
			if (flag)
			{
				if (tryToGetDefaultValue)
				{
					defaultValue = parameter.DefaultValue;
				}
				bool flag2 = parameter.ParameterType.IsGenericType && parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
				if (defaultValue == null && parameter.ParameterType.IsValueType && !flag2)
				{
					defaultValue = CreateValueType(parameter.ParameterType);
				}
				if (defaultValue != null && flag2)
				{
					Type underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
					if (underlyingType != null && underlyingType.IsEnum)
					{
						defaultValue = Enum.ToObject(underlyingType, defaultValue);
					}
				}
			}
			return flag;
			[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern", Justification = "CreateValueType is only called on a ValueType. You can always create an instance of a ValueType.")]
			static object? CreateValueType(Type t)
			{
				return FormatterServices.GetUninitializedObject(t);
			}
		}

		public static bool CheckHasDefaultValue(ParameterInfo parameter, out bool tryToGetDefaultValue)
		{
			tryToGetDefaultValue = true;
			try
			{
				return parameter.HasDefaultValue;
			}
			catch (FormatException) when (parameter.ParameterType == typeof(DateTime))
			{
				tryToGetDefaultValue = false;
				return true;
			}
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public class BinderOptions
	{
		public bool BindNonPublicProperties { get; set; }

		public bool ErrorOnUnknownConfiguration { get; set; }
	}
	internal sealed class BindingPoint
	{
		private readonly Func<object> _initialValueProvider;

		private object _initialValue;

		private object _setValue;

		private bool _valueSet;

		public bool IsReadOnly { get; }

		public bool HasNewValue
		{
			get
			{
				if (IsReadOnly)
				{
					return false;
				}
				if (_valueSet)
				{
					return true;
				}
				Type type = _initialValue?.GetType();
				if ((object)type != null && type.IsValueType)
				{
					return !type.IsPrimitive;
				}
				return false;
			}
		}

		public object? Value
		{
			get
			{
				object obj;
				if (!_valueSet)
				{
					obj = _initialValue;
					if (obj == null)
					{
						return _initialValue = _initialValueProvider?.Invoke();
					}
				}
				else
				{
					obj = _setValue;
				}
				return obj;
			}
		}

		public BindingPoint(object? initialValue = null, bool isReadOnly = false)
		{
			_initialValue = initialValue;
			IsReadOnly = isReadOnly;
		}

		public BindingPoint(Func<object?> initialValueProvider, bool isReadOnly)
		{
			_initialValueProvider = initialValueProvider;
			IsReadOnly = isReadOnly;
		}

		public void SetValue(object? newValue)
		{
			_setValue = newValue;
			_valueSet = true;
		}

		public void TrySetValue(object? newValue)
		{
			if (!IsReadOnly)
			{
				SetValue(newValue);
			}
		}
	}
	public static class ConfigurationBinder
	{
		private const BindingFlags DeclaredOnlyLookup = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		private const string DynamicCodeWarningMessage = "Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.";

		private const string TrimmingWarningMessage = "In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.";

		private const string InstanceGetTypeTrimmingWarningMessage = "Cannot statically analyze the type of instance so its members may be trimmed";

		private const string PropertyTrimmingWarningMessage = "Cannot statically analyze property.PropertyType so its members may be trimmed.";

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static T? Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration)
		{
			return configuration.Get<T>(delegate
			{
			});
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static T? Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, Action<BinderOptions>? configureOptions)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			object obj = configuration.Get(typeof(T), configureOptions);
			if (obj == null)
			{
				return default(T);
			}
			return (T)obj;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static object? Get(this IConfiguration configuration, Type type)
		{
			return configuration.Get(type, delegate
			{
			});
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static object? Get(this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, Action<BinderOptions>? configureOptions)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			BinderOptions binderOptions = new BinderOptions();
			configureOptions?.Invoke(binderOptions);
			BindingPoint bindingPoint = new BindingPoint();
			BindInstance(type, bindingPoint, configuration, binderOptions);
			return bindingPoint.Value;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
		public static void Bind(this IConfiguration configuration, string key, object? instance)
		{
			((IConfiguration)(object)configuration.GetSection(key)).Bind(instance);
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
		public static void Bind(this IConfiguration configuration, object? instance)
		{
			configuration.Bind(instance, delegate
			{
			});
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze the type of instance so its members may be trimmed")]
		public static void Bind(this IConfiguration configuration, object? instance, Action<BinderOptions>? configureOptions)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			if (instance != null)
			{
				BinderOptions binderOptions = new BinderOptions();
				configureOptions?.Invoke(binderOptions);
				BindingPoint bindingPoint = new BindingPoint(instance, isReadOnly: true);
				BindInstance(instance.GetType(), bindingPoint, configuration, binderOptions);
			}
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static T? GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key)
		{
			return configuration.GetValue(key, default(T));
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static T? GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key, T defaultValue)
		{
			return (T)configuration.GetValue(typeof(T), key, defaultValue);
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static object? GetValue(this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string key)
		{
			return configuration.GetValue(type, key, null);
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		public static object? GetValue(this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string key, object? defaultValue)
		{
			IConfigurationSection section = configuration.GetSection(key);
			string value = section.Value;
			if (value != null)
			{
				return ConvertValue(type, value, section.Path);
			}
			return defaultValue;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze property.PropertyType so its members may be trimmed.")]
		private static void BindProperties(object instance, IConfiguration configuration, BinderOptions options)
		{
			List<PropertyInfo> allProperties = GetAllProperties(instance.GetType());
			if (options.ErrorOnUnknownConfiguration)
			{
				HashSet<string> propertyNames = new HashSet<string>(allProperties.Select((PropertyInfo mp) => mp.Name), StringComparer.OrdinalIgnoreCase);
				IEnumerable<IConfigurationSection> children = configuration.GetChildren();
				List<string> list = (from cs in children
					where !propertyNames.Contains(cs.Key)
					select cs into mp
					select "'" + mp.Key + "'").ToList();
				if (list.Count > 0)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_MissingConfig, "ErrorOnUnknownConfiguration", "BinderOptions", instance.GetType(), string.Join(", ", list)));
				}
			}
			foreach (PropertyInfo item in allProperties)
			{
				BindProperty(item, instance, configuration, options);
			}
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze property.PropertyType so its members may be trimmed.")]
		private static void BindProperty(PropertyInfo property, object instance, IConfiguration config, BinderOptions options)
		{
			if (!(property.GetMethod == null) && (options.BindNonPublicProperties || property.GetMethod.IsPublic) && property.GetMethod.GetParameters().Length == 0)
			{
				BindingPoint bindingPoint = new BindingPoint(() => property.GetValue(instance), (object)property.SetMethod == null || (!property.SetMethod.IsPublic && !options.BindNonPublicProperties));
				BindInstance(property.PropertyType, bindingPoint, (IConfiguration)(object)config.GetSection(GetPropertyName(property)), options);
				if (!bindingPoint.IsReadOnly && bindingPoint.Value != null)
				{
					property.SetValue(instance, bindingPoint.Value);
				}
			}
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		private static void BindInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, BindingPoint bindingPoint, IConfiguration config, BinderOptions options)
		{
			if (type == typeof(IConfigurationSection))
			{
				bindingPoint.TrySetValue(config);
				return;
			}
			IConfigurationSection val = (IConfigurationSection)(object)((config is IConfigurationSection) ? config : null);
			string text = ((val != null) ? val.Value : null);
			if (text != null && TryConvertValue(type, text, (val != null) ? val.Path : null, out var result, out var error))
			{
				if (error != null)
				{
					throw error;
				}
				bindingPoint.TrySetValue(result);
			}
			else
			{
				if (config == null || !config.GetChildren().Any())
				{
					return;
				}
				if (type.IsArray || IsImmutableArrayCompatibleInterface(type))
				{
					if (!bindingPoint.IsReadOnly)
					{
						bindingPoint.SetValue(BindArray(type, (IEnumerable)bindingPoint.Value, config, options));
					}
					return;
				}
				if (TypeIsASetInterface(type) && !bindingPoint.IsReadOnly)
				{
					object obj = BindSet(type, (IEnumerable)bindingPoint.Value, config, options);
					if (obj != null)
					{
						bindingPoint.SetValue(obj);
					}
					return;
				}
				if (TypeIsADictionaryInterface(type) && !bindingPoint.IsReadOnly)
				{
					object obj2 = BindDictionaryInterface(bindingPoint.Value, type, config, options);
					if (obj2 != null)
					{
						bindingPoint.SetValue(obj2);
					}
					return;
				}
				if (bindingPoint.Value == null)
				{
					if (bindingPoint.IsReadOnly)
					{
						return;
					}
					Type type2 = ((type.IsInterface && type.IsConstructedGenericType) ? type.GetGenericTypeDefinition() : null);
					if ((object)type2 != null && (type2 == typeof(ICollection<>) || type2 == typeof(IList<>)))
					{
						Type type3 = typeof(List<>).MakeGenericType(type.GenericTypeArguments[0]);
						bindingPoint.SetValue(Activator.CreateInstance(type3));
					}
					else
					{
						bindingPoint.SetValue(CreateInstance(type, config, options));
					}
				}
				Type type4 = FindOpenGenericInterface(typeof(IDictionary<, >), type);
				if (type4 != null)
				{
					BindDictionary(bindingPoint.Value, type4, config, options);
					return;
				}
				Type type5 = FindOpenGenericInterface(typeof(ICollection<>), type);
				if (type5 != null)
				{
					BindCollection(bindingPoint.Value, type5, config, options);
				}
				else
				{
					BindProperties(bindingPoint.Value, config, options);
				}
			}
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("In case type is a Nullable<T>, cannot statically analyze what the underlying type is so its members may be trimmed.")]
		private static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, IConfiguration config, BinderOptions options)
		{
			if (type.IsInterface || type.IsAbstract)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_CannotActivateAbstractOrInterface, type));
			}
			ConstructorInfo[] constructors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public);
			bool flag = type.IsValueType || constructors.Any((ConstructorInfo ctor) => ctor.GetParameters().Length == 0);
			if (!type.IsValueType && constructors.Length == 0)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_MissingPublicInstanceConstructor, type));
			}
			if (constructors.Length > 1 && !flag)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_MultipleParameterizedConstructors, type));
			}
			if (constructors.Length == 1 && !flag)
			{
				ConstructorInfo constructorInfo = constructors[0];
				ParameterInfo[] parameters = constructorInfo.GetParameters();
				if (!CanBindToTheseConstructorParameters(parameters, out var nameOfInvalidParameter))
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_CannotBindToConstructorParameter, type, nameOfInvalidParameter));
				}
				List<PropertyInfo> allProperties = GetAllProperties(type);
				if (!DoAllParametersHaveEquivalentProperties(parameters, allProperties, out var missing))
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_ConstructorParametersDoNotMatchProperties, type, missing));
				}
				object[] array = new object[parameters.Length];
				for (int i = 0; i < parameters.Length; i++)
				{
					array[i] = BindParameter(parameters[i], type, config, options);
				}
				return constructorInfo.Invoke(array);
			}
			object obj;
			try
			{
				obj = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type);
			}
			catch (Exception innerException)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_FailedToActivate, type), innerException);
			}
			return obj ?? throw new InvalidOperationException(System.SR.Format(System.SR.Error_FailedToActivate, type));
		}

		private static bool DoAllParametersHaveEquivalentProperties(ParameterInfo[] parameters, List<PropertyInfo> properties, out string missing)
		{
			HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
			foreach (PropertyInfo property in properties)
			{
				hashSet.Add(property.Name);
			}
			List<string> list = new List<string>();
			foreach (ParameterInfo parameterInfo in parameters)
			{
				string name = parameterInfo.Name;
				if (!hashSet.Contains(name))
				{
					list.Add(name);
				}
			}
			missing = string.Join(",", list);
			return missing.Length == 0;
		}

		private static bool CanBindToTheseConstructorParameters(ParameterInfo[] constructorParameters, out string nameOfInvalidParameter)
		{
			nameOfInvalidParameter = string.Empty;
			foreach (ParameterInfo parameterInfo in constructorParameters)
			{
				if (parameterInfo.IsOut || parameterInfo.IsIn || parameterInfo.ParameterType.IsByRef)
				{
					nameOfInvalidParameter = parameterInfo.Name;
					return false;
				}
			}
			return true;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze what the element type is of the value objects in the dictionary so its members may be trimmed.")]
		private static object BindDictionaryInterface(object source, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type dictionaryType, IConfiguration config, BinderOptions options)
		{
			Type type = dictionaryType.GenericTypeArguments[0];
			Type type2 = dictionaryType.GenericTypeArguments[1];
			bool isEnum = type.IsEnum;
			bool flag = type == typeof(sbyte) || type == typeof(byte) || type == typeof(short) || type == typeof(ushort) || type == typeof(int) || type == typeof(uint) || type == typeof(long) || type == typeof(ulong);
			if (type != typeof(string) && !isEnum && !flag)
			{
				return null;
			}
			Type type3 = typeof(Dictionary<, >).MakeGenericType(type, type2);
			MethodInfo method = type3.GetMethod("Add", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			Type type4 = typeof(KeyValuePair<, >).MakeGenericType(type, type2);
			PropertyInfo property = type4.GetProperty("Key", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			PropertyInfo property2 = type4.GetProperty("Value", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			object obj = Activator.CreateInstance(type3);
			IEnumerable enumerable = source as IEnumerable;
			object[] array = new object[2];
			if (enumerable != null)
			{
				foreach (object item in enumerable)
				{
					object obj2 = property.GetMethod.Invoke(item, null);
					object obj3 = property2.GetMethod.Invoke(item, null);
					array[0] = obj2;
					array[1] = obj3;
					method.Invoke(obj, array);
				}
			}
			BindDictionary(obj, type3, config, options);
			return obj;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze what the element type is of the value objects in the dictionary so its members may be trimmed.")]
		private static void BindDictionary(object dictionary, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type dictionaryType, IConfiguration config, BinderOptions options)
		{
			Type type = dictionaryType.GenericTypeArguments[0];
			Type type2 = dictionaryType.GenericTypeArguments[1];
			bool isEnum = type.IsEnum;
			bool flag = type == typeof(sbyte) || type == typeof(byte) || type == typeof(short) || type == typeof(ushort) || type == typeof(int) || type == typeof(uint) || type == typeof(long) || type == typeof(ulong);
			if (type != typeof(string) && !isEnum && !flag)
			{
				return;
			}
			MethodInfo tryGetValue = dictionaryType.GetMethod("TryGetValue", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			PropertyInfo property = dictionaryType.GetProperty("Item", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			if ((object)property == null || !property.CanWrite)
			{
				return;
			}
			foreach (IConfigurationSection child in config.GetChildren())
			{
				try
				{
					object key = (isEnum ? Enum.Parse(type, child.Key, ignoreCase: true) : (flag ? Convert.ChangeType(child.Key, type) : child.Key));
					BindingPoint bindingPoint = new BindingPoint(delegate
					{
						object[] array = new object[2] { key, null };
						return (!(bool)tryGetValue.Invoke(dictionary, array)) ? null : array[1];
					}, isReadOnly: false);
					BindInstance(type2, bindingPoint, (IConfiguration)(object)child, options);
					if (bindingPoint.HasNewValue)
					{
						property.SetValue(dictionary, bindingPoint.Value, new object[1] { key });
					}
				}
				catch
				{
				}
			}
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze what the element type is of the object collection so its members may be trimmed.")]
		private static void BindCollection(object collection, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type collectionType, IConfiguration config, BinderOptions options)
		{
			Type type = collectionType.GenericTypeArguments[0];
			MethodInfo method = collectionType.GetMethod("Add", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (IConfigurationSection child in config.GetChildren())
			{
				try
				{
					BindingPoint bindingPoint = new BindingPoint();
					BindInstance(type, bindingPoint, (IConfiguration)(object)child, options);
					if (bindingPoint.HasNewValue)
					{
						method?.Invoke(collection, new object[1] { bindingPoint.Value });
					}
				}
				catch
				{
				}
			}
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze what the element type is of the Array so its members may be trimmed.")]
		private static Array BindArray(Type type, IEnumerable source, IConfiguration config, BinderOptions options)
		{
			Type type2;
			if (type.IsArray)
			{
				if (type.GetArrayRank() > 1)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_UnsupportedMultidimensionalArray, type));
				}
				type2 = type.GetElementType();
			}
			else
			{
				type2 = type.GetGenericArguments()[0];
			}
			IList list = new List<object>();
			if (source != null)
			{
				foreach (object item in source)
				{
					list.Add(item);
				}
			}
			foreach (IConfigurationSection child in config.GetChildren())
			{
				BindingPoint bindingPoint = new BindingPoint();
				try
				{
					BindInstance(type2, bindingPoint, (IConfiguration)(object)child, options);
					if (bindingPoint.HasNewValue)
					{
						list.Add(bindingPoint.Value);
					}
				}
				catch
				{
				}
			}
			Array array = Array.CreateInstance(type2, list.Count);
			list.CopyTo(array, 0);
			return array;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze what the element type is of the Array so its members may be trimmed.")]
		private static object BindSet(Type type, IEnumerable source, IConfiguration config, BinderOptions options)
		{
			Type type2 = type.GetGenericArguments()[0];
			Type type3 = type.GenericTypeArguments[0];
			bool isEnum = type3.IsEnum;
			if (type3 != typeof(string) && !isEnum)
			{
				return null;
			}
			Type type4 = typeof(HashSet<>).MakeGenericType(type3);
			object obj = Activator.CreateInstance(type4);
			MethodInfo method = type4.GetMethod("Add", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			object[] array = new object[1];
			if (source != null)
			{
				foreach (object item in source)
				{
					array[0] = item;
					method.Invoke(obj, array);
				}
			}
			foreach (IConfigurationSection child in config.GetChildren())
			{
				BindingPoint bindingPoint = new BindingPoint();
				try
				{
					BindInstance(type2, bindingPoint, (IConfiguration)(object)child, options);
					if (bindingPoint.HasNewValue)
					{
						array[0] = bindingPoint.Value;
						method.Invoke(obj, array);
					}
				}
				catch
				{
				}
			}
			return obj;
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		private static bool TryConvertValue([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string value, string path, out object result, out Exception error)
		{
			error = null;
			result = null;
			if (type == typeof(object))
			{
				result = value;
				return true;
			}
			if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
			{
				if (string.IsNullOrEmpty(value))
				{
					return true;
				}
				return TryConvertValue(Nullable.GetUnderlyingType(type), value, path, out result, out error);
			}
			TypeConverter converter = TypeDescriptor.GetConverter(type);
			if (converter.CanConvertFrom(typeof(string)))
			{
				try
				{
					result = converter.ConvertFromInvariantString(value);
				}
				catch (Exception innerException)
				{
					error = new InvalidOperationException(System.SR.Format(System.SR.Error_FailedBinding, path, type), innerException);
				}
				return true;
			}
			if (type == typeof(byte[]))
			{
				try
				{
					result = Convert.FromBase64String(value);
				}
				catch (FormatException innerException2)
				{
					error = new InvalidOperationException(System.SR.Format(System.SR.Error_FailedBinding, path, type), innerException2);
				}
				return true;
			}
			return false;
		}

		[RequiresUnreferencedCode("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")]
		private static object ConvertValue([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string value, string path)
		{
			TryConvertValue(type, value, path, out var result, out var error);
			if (error != null)
			{
				throw error;
			}
			return result;
		}

		private static bool TypeIsADictionaryInterface(Type type)
		{
			if (!type.IsInterface || !type.IsConstructedGenericType)
			{
				return false;
			}
			Type genericTypeDefinition = type.GetGenericTypeDefinition();
			if (!(genericTypeDefinition == typeof(IDictionary<, >)))
			{
				return genericTypeDefinition == typeof(IReadOnlyDictionary<, >);
			}
			return true;
		}

		private static bool IsImmutableArrayCompatibleInterface(Type type)
		{
			if (!type.IsInterface || !type.IsConstructedGenericType)
			{
				return false;
			}
			Type genericTypeDefinition = type.GetGenericTypeDefinition();
			if (!(genericTypeDefinition == typeof(IEnumerable<>)) && !(genericTypeDefinition == typeof(IReadOnlyCollection<>)))
			{
				return genericTypeDefinition == typeof(IReadOnlyList<>);
			}
			return true;
		}

		private static bool TypeIsASetInterface(Type type)
		{
			if (!type.IsInterface || !type.IsConstructedGenericType)
			{
				return false;
			}
			Type genericTypeDefinition = type.GetGenericTypeDefinition();
			return genericTypeDefinition == typeof(ISet<>);
		}

		private static Type FindOpenGenericInterface(Type expected, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type actual)
		{
			if (actual.IsGenericType && actual.GetGenericTypeDefinition() == expected)
			{
				return actual;
			}
			Type[] interfaces = actual.GetInterfaces();
			Type[] array = interfaces;
			foreach (Type type in array)
			{
				if (type.IsGenericType && type.GetGenericTypeDefinition() == expected)
				{
					return type;
				}
			}
			return null;
		}

		private static List<PropertyInfo> GetAllProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
		{
			List<PropertyInfo> list = new List<PropertyInfo>();
			Type type2 = type;
			while (type2 != typeof(object))
			{
				PropertyInfo[] properties = type2.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
				PropertyInfo[] array = properties;
				foreach (PropertyInfo propertyInfo in array)
				{
					MethodInfo setMethod = propertyInfo.GetSetMethod(nonPublic: true);
					if ((object)setMethod == null || !setMethod.IsVirtual || setMethod == setMethod.GetBaseDefinition())
					{
						list.Add(propertyInfo);
					}
				}
				type2 = type2.BaseType;
			}
			return list;
		}

		[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types.")]
		[RequiresUnreferencedCode("Cannot statically analyze property.PropertyType so its members may be trimmed.")]
		private static object BindParameter(ParameterInfo parameter, Type type, IConfiguration config, BinderOptions options)
		{
			string name = parameter.Name;
			if (name == null)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_ParameterBeingBoundToIsUnnamed, type));
			}
			BindingPoint bindingPoint = new BindingPoint(config.GetSection(name).Value);
			if (bindingPoint.Value == null)
			{
				if (!ParameterDefaultValue.TryGetDefaultValue(parameter, out object defaultValue))
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_ParameterHasNoMatchingConfig, type, name));
				}
				bindingPoint.SetValue(defaultValue);
			}
			BindInstance(parameter.ParameterType, bindingPoint, (IConfiguration)(object)config.GetSection(name), options);
			return bindingPoint.Value;
		}

		private static string GetPropertyName(MemberInfo property)
		{
			System.ThrowHelper.ThrowIfNull(property, "property");
			foreach (CustomAttributeData customAttributesDatum in property.GetCustomAttributesData())
			{
				if (!(customAttributesDatum.AttributeType != typeof(ConfigurationKeyNameAttribute)))
				{
					if (customAttributesDatum.ConstructorArguments.Count != 1)
					{
						break;
					}
					string text = customAttributesDatum.ConstructorArguments[0].Value?.ToString();
					return (!string.IsNullOrWhiteSpace(text)) ? text : property.Name;
				}
			}
			return property.Name;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.CommandLine.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.Configuration.CommandLine;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration.CommandLine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.CommandLine.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.CommandLine")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Command line configuration provider implementation for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.CommandLine")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.CommandLine
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_DuplicatedKeyInSwitchMappings => GetResourceString("Error_DuplicatedKeyInSwitchMappings");

		internal static string Error_InvalidSwitchMapping => GetResourceString("Error_InvalidSwitchMapping");

		internal static string Error_ShortSwitchNotDefined => GetResourceString("Error_ShortSwitchNotDefined");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class CommandLineConfigurationExtensions
	{
		public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder configurationBuilder, string[] args)
		{
			return configurationBuilder.AddCommandLine(args, null);
		}

		public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder configurationBuilder, string[] args, IDictionary<string, string>? switchMappings)
		{
			configurationBuilder.Add((IConfigurationSource)(object)new CommandLineConfigurationSource
			{
				Args = args,
				SwitchMappings = switchMappings
			});
			return configurationBuilder;
		}

		public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, Action<CommandLineConfigurationSource>? configureSource)
		{
			return ConfigurationExtensions.Add<CommandLineConfigurationSource>(builder, configureSource);
		}
	}
}
namespace Microsoft.Extensions.Configuration.CommandLine
{
	public class CommandLineConfigurationProvider : ConfigurationProvider
	{
		private readonly Dictionary<string, string> _switchMappings;

		protected IEnumerable<string> Args { get; private set; }

		public CommandLineConfigurationProvider(IEnumerable<string> args, IDictionary<string, string>? switchMappings = null)
		{
			System.ThrowHelper.ThrowIfNull(args, "args");
			Args = args;
			if (switchMappings != null)
			{
				_switchMappings = GetValidatedSwitchMappingsCopy(switchMappings);
			}
		}

		public override void Load()
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
			using (IEnumerator<string> enumerator = Args.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					string text = enumerator.Current;
					int num = 0;
					if (text.StartsWith("--"))
					{
						num = 2;
					}
					else if (text.StartsWith("-"))
					{
						num = 1;
					}
					else if (text.StartsWith("/"))
					{
						text = "--" + text.Substring(1);
						num = 2;
					}
					int num2 = text.IndexOf('=');
					string key;
					string value2;
					if (num2 < 0)
					{
						if (num == 0)
						{
							continue;
						}
						if (_switchMappings != null && _switchMappings.TryGetValue(text, out var value))
						{
							key = value;
						}
						else
						{
							if (num == 1)
							{
								continue;
							}
							key = text.Substring(num);
						}
						if (!enumerator.MoveNext())
						{
							continue;
						}
						value2 = enumerator.Current;
					}
					else
					{
						string key2 = text.Substring(0, num2);
						if (_switchMappings != null && _switchMappings.TryGetValue(key2, out var value3))
						{
							key = value3;
						}
						else
						{
							if (num == 1)
							{
								throw new FormatException(System.SR.Format(System.SR.Error_ShortSwitchNotDefined, text));
							}
							key = text.Substring(num, num2 - num);
						}
						value2 = text.Substring(num2 + 1);
					}
					dictionary[key] = value2;
				}
			}
			((ConfigurationProvider)this).Data = dictionary;
		}

		private static Dictionary<string, string> GetValidatedSwitchMappingsCopy(IDictionary<string, string> switchMappings)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>(switchMappings.Count, StringComparer.OrdinalIgnoreCase);
			foreach (KeyValuePair<string, string> switchMapping in switchMappings)
			{
				if (!switchMapping.Key.StartsWith("-") && !switchMapping.Key.StartsWith("--"))
				{
					throw new ArgumentException(System.SR.Format(System.SR.Error_InvalidSwitchMapping, switchMapping.Key), "switchMappings");
				}
				if (dictionary.ContainsKey(switchMapping.Key))
				{
					throw new ArgumentException(System.SR.Format(System.SR.Error_DuplicatedKeyInSwitchMappings, switchMapping.Key), "switchMappings");
				}
				dictionary.Add(switchMapping.Key, switchMapping.Value);
			}
			return dictionary;
		}
	}
	public class CommandLineConfigurationSource : IConfigurationSource
	{
		public IDictionary<string, string>? SwitchMappings { get; set; }

		public IEnumerable<string> Args { get; set; } = Array.Empty<string>();


		public IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			return (IConfigurationProvider)(object)new CommandLineConfigurationProvider(Args, SwitchMappings);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using FxResources.Microsoft.Extensions.Configuration;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration.Memory;
using Microsoft.Extensions.Primitives;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_NoSources => GetResourceString("Error_NoSources");

		internal static string InvalidNullArgument => GetResourceString("InvalidNullArgument");

		internal static string StreamConfigurationProvidersAlreadyLoaded => GetResourceString("StreamConfigurationProvidersAlreadyLoaded");

		internal static string StreamConfigurationSourceStreamCannotBeNull => GetResourceString("StreamConfigurationSourceStreamCannotBeNull");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class ChainedBuilderExtensions
	{
		public static IConfigurationBuilder AddConfiguration(this IConfigurationBuilder configurationBuilder, IConfiguration config)
		{
			return configurationBuilder.AddConfiguration(config, shouldDisposeConfiguration: false);
		}

		public static IConfigurationBuilder AddConfiguration(this IConfigurationBuilder configurationBuilder, IConfiguration config, bool shouldDisposeConfiguration)
		{
			System.ThrowHelper.ThrowIfNull(configurationBuilder, "configurationBuilder");
			System.ThrowHelper.ThrowIfNull(config, "config");
			configurationBuilder.Add((IConfigurationSource)(object)new ChainedConfigurationSource
			{
				Configuration = config,
				ShouldDisposeConfiguration = shouldDisposeConfiguration
			});
			return configurationBuilder;
		}
	}
	public class ChainedConfigurationProvider : IConfigurationProvider, IDisposable
	{
		private readonly IConfiguration _config;

		private readonly bool _shouldDisposeConfig;

		public IConfiguration Configuration => _config;

		public ChainedConfigurationProvider(ChainedConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			_config = source.Configuration ?? throw new ArgumentException(System.SR.Format(System.SR.InvalidNullArgument, "source.Configuration"), "source");
			_shouldDisposeConfig = source.ShouldDisposeConfiguration;
		}

		public bool TryGet(string key, out string? value)
		{
			value = _config[key];
			return !string.IsNullOrEmpty(value);
		}

		public void Set(string key, string? value)
		{
			_config[key] = value;
		}

		public IChangeToken GetReloadToken()
		{
			return _config.GetReloadToken();
		}

		public void Load()
		{
		}

		public IEnumerable<string> GetChildKeys(IEnumerable<string> earlierKeys, string? parentPath)
		{
			IConfiguration obj;
			if (parentPath != null)
			{
				IConfiguration section = (IConfiguration)(object)_config.GetSection(parentPath);
				obj = section;
			}
			else
			{
				obj = _config;
			}
			IConfiguration val = obj;
			List<string> list = new List<string>();
			foreach (IConfigurationSection child in val.GetChildren())
			{
				list.Add(child.Key);
			}
			list.AddRange(earlierKeys);
			list.Sort(ConfigurationKeyComparer.Comparison);
			return list;
		}

		public void Dispose()
		{
			if (_shouldDisposeConfig)
			{
				(_config as IDisposable)?.Dispose();
			}
		}
	}
	public class ChainedConfigurationSource : IConfigurationSource
	{
		public IConfiguration? Configuration
		{
			get; [param: DisallowNull]
			set;
		}

		public bool ShouldDisposeConfiguration { get; set; }

		public IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			return (IConfigurationProvider)(object)new ChainedConfigurationProvider(this);
		}
	}
	public class ConfigurationBuilder : IConfigurationBuilder
	{
		public IList<IConfigurationSource> Sources { get; } = new List<IConfigurationSource>();


		public IDictionary<string, object> Properties { get; } = new Dictionary<string, object>();


		public IConfigurationBuilder Add(IConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			Sources.Add(source);
			return (IConfigurationBuilder)(object)this;
		}

		public IConfigurationRoot Build()
		{
			List<IConfigurationProvider> list = new List<IConfigurationProvider>();
			foreach (IConfigurationSource source in Sources)
			{
				IConfigurationProvider item = source.Build((IConfigurationBuilder)(object)this);
				list.Add(item);
			}
			return (IConfigurationRoot)(object)new ConfigurationRoot(list);
		}
	}
	public class ConfigurationKeyComparer : IComparer<string>
	{
		private const char KeyDelimiter = ':';

		public static ConfigurationKeyComparer Instance { get; } = new ConfigurationKeyComparer();


		internal static Comparison<string> Comparison { get; } = Instance.Compare;


		public int Compare(string? x, string? y)
		{
			ReadOnlySpan<char> readOnlySpan = x.AsSpan();
			ReadOnlySpan<char> readOnlySpan2 = y.AsSpan();
			readOnlySpan = SkipAheadOnDelimiter(readOnlySpan);
			readOnlySpan2 = SkipAheadOnDelimiter(readOnlySpan2);
			while (!readOnlySpan.IsEmpty && !readOnlySpan2.IsEmpty)
			{
				int num = readOnlySpan.IndexOf(':');
				int num2 = readOnlySpan2.IndexOf(':');
				int num3 = Compare((num == -1) ? readOnlySpan : readOnlySpan.Slice(0, num), (num2 == -1) ? readOnlySpan2 : readOnlySpan2.Slice(0, num2));
				if (num3 != 0)
				{
					return num3;
				}
				readOnlySpan = ((num == -1) ? default(ReadOnlySpan<char>) : SkipAheadOnDelimiter(readOnlySpan.Slice(num + 1)));
				readOnlySpan2 = ((num2 == -1) ? default(ReadOnlySpan<char>) : SkipAheadOnDelimiter(readOnlySpan2.Slice(num2 + 1)));
			}
			if (!readOnlySpan.IsEmpty)
			{
				return 1;
			}
			if (!readOnlySpan2.IsEmpty)
			{
				return -1;
			}
			return 0;
			static int Compare(ReadOnlySpan<char> a, ReadOnlySpan<char> b)
			{
				int result;
				bool flag = int.TryParse(a.ToString(), out result);
				int result2;
				bool flag2 = int.TryParse(b.ToString(), out result2);
				if (!flag && !flag2)
				{
					return a.CompareTo(b, StringComparison.OrdinalIgnoreCase);
				}
				if (flag && flag2)
				{
					return result - result2;
				}
				return (!flag) ? 1 : (-1);
			}
			static ReadOnlySpan<char> SkipAheadOnDelimiter(ReadOnlySpan<char> a)
			{
				while (!a.IsEmpty && a[0] == ':')
				{
					a = a.Slice(1);
				}
				return a;
			}
		}
	}
	public sealed class ConfigurationManager : IConfigurationBuilder, IConfigurationRoot, IConfiguration, IDisposable
	{
		private sealed class ConfigurationSources : IList<IConfigurationSource>, ICollection<IConfigurationSource>, IEnumerable<IConfigurationSource>, IEnumerable
		{
			private readonly List<IConfigurationSource> _sources = new List<IConfigurationSource>();

			private readonly ConfigurationManager _config;

			public IConfigurationSource this[int index]
			{
				get
				{
					return _sources[index];
				}
				set
				{
					_sources[index] = value;
					_config.ReloadSources();
				}
			}

			public int Count => _sources.Count;

			public bool IsReadOnly => false;

			public ConfigurationSources(ConfigurationManager config)
			{
				_config = config;
			}

			public void Add(IConfigurationSource source)
			{
				_sources.Add(source);
				_config.AddSource(source);
			}

			public void Clear()
			{
				_sources.Clear();
				_config.ReloadSources();
			}

			public bool Contains(IConfigurationSource source)
			{
				return _sources.Contains(source);
			}

			public void CopyTo(IConfigurationSource[] array, int arrayIndex)
			{
				_sources.CopyTo(array, arrayIndex);
			}

			public IEnumerator<IConfigurationSource> GetEnumerator()
			{
				return _sources.GetEnumerator();
			}

			public int IndexOf(IConfigurationSource source)
			{
				return _sources.IndexOf(source);
			}

			public void Insert(int index, IConfigurationSource source)
			{
				_sources.Insert(index, source);
				_config.ReloadSources();
			}

			public bool Remove(IConfigurationSource source)
			{
				bool result = _sources.Remove(source);
				_config.ReloadSources();
				return result;
			}

			public void RemoveAt(int index)
			{
				_sources.RemoveAt(index);
				_config.ReloadSources();
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private sealed class ConfigurationBuilderProperties : IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			private readonly Dictionary<string, object> _properties = new Dictionary<string, object>();

			private readonly ConfigurationManager _config;

			public object this[string key]
			{
				get
				{
					return _properties[key];
				}
				set
				{
					_properties[key] = value;
					_config.ReloadSources();
				}
			}

			public ICollection<string> Keys => _properties.Keys;

			public ICollection<object> Values => _properties.Values;

			public int Count => _properties.Count;

			public bool IsReadOnly => false;

			public ConfigurationBuilderProperties(ConfigurationManager config)
			{
				_config = config;
			}

			public void Add(string key, object value)
			{
				_properties.Add(key, value);
				_config.ReloadSources();
			}

			public void Add(KeyValuePair<string, object> item)
			{
				((ICollection<KeyValuePair<string, object>>)_properties).Add(item);
				_config.ReloadSources();
			}

			public void Clear()
			{
				_properties.Clear();
				_config.ReloadSources();
			}

			public bool Contains(KeyValuePair<string, object> item)
			{
				return _properties.Contains(item);
			}

			public bool ContainsKey(string key)
			{
				return _properties.ContainsKey(key);
			}

			public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
			{
				((ICollection<KeyValuePair<string, object>>)_properties).CopyTo(array, arrayIndex);
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				return _properties.GetEnumerator();
			}

			public bool Remove(string key)
			{
				bool result = _properties.Remove(key);
				_config.ReloadSources();
				return result;
			}

			public bool Remove(KeyValuePair<string, object> item)
			{
				bool result = ((ICollection<KeyValuePair<string, object>>)_properties).Remove(item);
				_config.ReloadSources();
				return result;
			}

			public bool TryGetValue(string key, [NotNullWhen(true)] out object value)
			{
				return _properties.TryGetValue(key, out value);
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return _properties.GetEnumerator();
			}
		}

		private readonly ConfigurationSources _sources;

		private readonly ConfigurationBuilderProperties _properties;

		private readonly ReferenceCountedProviderManager _providerManager = new ReferenceCountedProviderManager();

		private readonly List<IDisposable> _changeTokenRegistrations = new List<IDisposable>();

		private ConfigurationReloadToken _changeToken = new ConfigurationReloadToken();

		public string? this[string key]
		{
			get
			{
				using ReferenceCountedProviders referenceCountedProviders = _providerManager.GetReference();
				return ConfigurationRoot.GetConfiguration(referenceCountedProviders.Providers, key);
			}
			set
			{
				using ReferenceCountedProviders referenceCountedProviders = _providerManager.GetReference();
				ConfigurationRoot.SetConfiguration(referenceCountedProviders.Providers, key, value);
			}
		}

		IDictionary<string, object> IConfigurationBuilder.Properties => _properties;

		public IList<IConfigurationSource> Sources => _sources;

		IEnumerable<IConfigurationProvider> IConfigurationRoot.Providers => _providerManager.NonReferenceCountedProviders;

		public ConfigurationManager()
		{
			_sources = new ConfigurationSources(this);
			_properties = new ConfigurationBuilderProperties(this);
			_sources.Add((IConfigurationSource)(object)new MemoryConfigurationSource());
		}

		public IConfigurationSection GetSection(string key)
		{
			return (IConfigurationSection)(object)new ConfigurationSection((IConfigurationRoot)(object)this, key);
		}

		public IEnumerable<IConfigurationSection> GetChildren()
		{
			return ((IConfigurationRoot)(object)this).GetChildrenImplementation(null);
		}

		public void Dispose()
		{
			DisposeRegistrations();
			_providerManager.Dispose();
		}

		IConfigurationBuilder IConfigurationBuilder.Add(IConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			_sources.Add(source);
			return (IConfigurationBuilder)(object)this;
		}

		IConfigurationRoot IConfigurationBuilder.Build()
		{
			return (IConfigurationRoot)(object)this;
		}

		IChangeToken IConfiguration.GetReloadToken()
		{
			return (IChangeToken)(object)_changeToken;
		}

		void IConfigurationRoot.Reload()
		{
			using (ReferenceCountedProviders referenceCountedProviders = _providerManager.GetReference())
			{
				foreach (IConfigurationProvider provider in referenceCountedProviders.Providers)
				{
					provider.Load();
				}
			}
			RaiseChanged();
		}

		internal ReferenceCountedProviders GetProvidersReference()
		{
			return _providerManager.GetReference();
		}

		private void RaiseChanged()
		{
			ConfigurationReloadToken configurationReloadToken = Interlocked.Exchange(ref _changeToken, new ConfigurationReloadToken());
			configurationReloadToken.OnReload();
		}

		private void AddSource(IConfigurationSource source)
		{
			IConfigurationProvider val = source.Build((IConfigurationBuilder)(object)this);
			val.Load();
			_changeTokenRegistrations.Add(ChangeToken.OnChange((Func<IChangeToken>)val.GetReloadToken, (Action)RaiseChanged));
			_providerManager.AddProvider(val);
			RaiseChanged();
		}

		private void ReloadSources()
		{
			DisposeRegistrations();
			_changeTokenRegistrations.Clear();
			List<IConfigurationProvider> list = new List<IConfigurationProvider>();
			foreach (IConfigurationSource source in _sources)
			{
				list.Add(source.Build((IConfigurationBuilder)(object)this));
			}
			foreach (IConfigurationProvider item in list)
			{
				item.Load();
				_changeTokenRegistrations.Add(ChangeToken.OnChange((Func<IChangeToken>)item.GetReloadToken, (Action)RaiseChanged));
			}
			_providerManager.ReplaceProviders(list);
			RaiseChanged();
		}

		private void DisposeRegistrations()
		{
			foreach (IDisposable changeTokenRegistration in _changeTokenRegistrations)
			{
				changeTokenRegistration.Dispose();
			}
		}
	}
	public abstract class ConfigurationProvider : IConfigurationProvider
	{
		private ConfigurationReloadToken _reloadToken = new ConfigurationReloadToken();

		protected IDictionary<string, string?> Data { get; set; }

		protected ConfigurationProvider()
		{
			Data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
		}

		public virtual bool TryGet(string key, out string? value)
		{
			return Data.TryGetValue(key, out value);
		}

		public virtual void Set(string key, string? value)
		{
			Data[key] = value;
		}

		public virtual void Load()
		{
		}

		public virtual IEnumerable<string> GetChildKeys(IEnumerable<string> earlierKeys, string? parentPath)
		{
			List<string> list = new List<string>();
			if (parentPath == null)
			{
				foreach (KeyValuePair<string, string> datum in Data)
				{
					list.Add(Segment(datum.Key, 0));
				}
			}
			else
			{
				foreach (KeyValuePair<string, string> datum2 in Data)
				{
					if (datum2.Key.Length > parentPath.Length && datum2.Key.StartsWith(parentPath, StringComparison.OrdinalIgnoreCase) && datum2.Key[parentPath.Length] == ':')
					{
						list.Add(Segment(datum2.Key, parentPath.Length + 1));
					}
				}
			}
			list.AddRange(earlierKeys);
			list.Sort(ConfigurationKeyComparer.Comparison);
			return list;
		}

		private static string Segment(string key, int prefixLength)
		{
			int num = key.IndexOf(ConfigurationPath.KeyDelimiter, prefixLength, StringComparison.OrdinalIgnoreCase);
			if (num >= 0)
			{
				return key.Substring(prefixLength, num - prefixLength);
			}
			return key.Substring(prefixLength);
		}

		public IChangeToken GetReloadToken()
		{
			return (IChangeToken)(object)_reloadToken;
		}

		protected void OnReload()
		{
			ConfigurationReloadToken configurationReloadToken = Interlocked.Exchange(ref _reloadToken, new ConfigurationReloadToken());
			configurationReloadToken.OnReload();
		}

		public override string ToString()
		{
			return GetType().Name ?? "";
		}
	}
	public class ConfigurationReloadToken : IChangeToken
	{
		private CancellationTokenSource _cts = new CancellationTokenSource();

		public bool ActiveChangeCallbacks => true;

		public bool HasChanged => _cts.IsCancellationRequested;

		public IDisposable RegisterChangeCallback(Action<object?> callback, object? state)
		{
			return _cts.Token.Register(callback, state);
		}

		public void OnReload()
		{
			_cts.Cancel();
		}
	}
	public class ConfigurationRoot : IConfigurationRoot, IConfiguration, IDisposable
	{
		private readonly IList<IConfigurationProvider> _providers;

		private readonly IList<IDisposable> _changeTokenRegistrations;

		private ConfigurationReloadToken _changeToken = new ConfigurationReloadToken();

		public IEnumerable<IConfigurationProvider> Providers => _providers;

		public string? this[string key]
		{
			get
			{
				return GetConfiguration(_providers, key);
			}
			set
			{
				SetConfiguration(_providers, key, value);
			}
		}

		public ConfigurationRoot(IList<IConfigurationProvider> providers)
		{
			System.ThrowHelper.ThrowIfNull(providers, "providers");
			_providers = providers;
			_changeTokenRegistrations = new List<IDisposable>(providers.Count);
			foreach (IConfigurationProvider provider in providers)
			{
				provider.Load();
				_changeTokenRegistrations.Add(ChangeToken.OnChange((Func<IChangeToken>)provider.GetReloadToken, (Action)RaiseChanged));
			}
		}

		public IEnumerable<IConfigurationSection> GetChildren()
		{
			return ((IConfigurationRoot)(object)this).GetChildrenImplementation(null);
		}

		public IChangeToken GetReloadToken()
		{
			return (IChangeToken)(object)_changeToken;
		}

		public IConfigurationSection GetSection(string key)
		{
			return (IConfigurationSection)(object)new ConfigurationSection((IConfigurationRoot)(object)this, key);
		}

		public void Reload()
		{
			foreach (IConfigurationProvider provider in _providers)
			{
				provider.Load();
			}
			RaiseChanged();
		}

		private void RaiseChanged()
		{
			ConfigurationReloadToken configurationReloadToken = Interlocked.Exchange(ref _changeToken, new ConfigurationReloadToken());
			configurationReloadToken.OnReload();
		}

		public void Dispose()
		{
			foreach (IDisposable changeTokenRegistration in _changeTokenRegistrations)
			{
				changeTokenRegistration.Dispose();
			}
			foreach (IConfigurationProvider provider in _providers)
			{
				(provider as IDisposable)?.Dispose();
			}
		}

		internal static string? GetConfiguration(IList<IConfigurationProvider> providers, string key)
		{
			string result = default(string);
			for (int num = providers.Count - 1; num >= 0; num--)
			{
				IConfigurationProvider val = providers[num];
				if (val.TryGet(key, ref result))
				{
					return result;
				}
			}
			return null;
		}

		internal static void SetConfiguration(IList<IConfigurationProvider> providers, string key, string? value)
		{
			if (providers.Count == 0)
			{
				throw new InvalidOperationException(System.SR.Error_NoSources);
			}
			foreach (IConfigurationProvider provider in providers)
			{
				provider.Set(key, value);
			}
		}
	}
	public class ConfigurationSection : IConfigurationSection, IConfiguration
	{
		private readonly IConfigurationRoot _root;

		private readonly string _path;

		private string _key;

		public string Path => _path;

		public string Key => _key ?? (_key = ConfigurationPath.GetSectionKey(_path));

		public string? Value
		{
			get
			{
				return ((IConfiguration)_root)[Path];
			}
			set
			{
				((IConfiguration)_root)[Path] = value;
			}
		}

		public string? this[string key]
		{
			get
			{
				return ((IConfiguration)_root)[ConfigurationPath.Combine(new string[2] { Path, key })];
			}
			set
			{
				((IConfiguration)_root)[ConfigurationPath.Combine(new string[2] { Path, key })] = value;
			}
		}

		public ConfigurationSection(IConfigurationRoot root, string path)
		{
			System.ThrowHelper.ThrowIfNull(root, "root");
			System.ThrowHelper.ThrowIfNull(path, "path");
			_root = root;
			_path = path;
		}

		public IConfigurationSection GetSection(string key)
		{
			return ((IConfiguration)_root).GetSection(ConfigurationPath.Combine(new string[2] { Path, key }));
		}

		public IEnumerable<IConfigurationSection> GetChildren()
		{
			return _root.GetChildrenImplementation(Path);
		}

		public IChangeToken GetReloadToken()
		{
			return ((IConfiguration)_root).GetReloadToken();
		}
	}
	internal static class InternalConfigurationRootExtensions
	{
		internal static IEnumerable<IConfigurationSection> GetChildrenImplementation(this IConfigurationRoot root, string? path)
		{
			string path2 = path;
			IConfigurationRoot root2 = root;
			using ReferenceCountedProviders referenceCountedProviders = (root2 as ConfigurationManager)?.GetProvidersReference();
			IEnumerable<IConfigurationProvider> enumerable = referenceCountedProviders?.Providers;
			IEnumerable<IConfigurationProvider> source2 = enumerable ?? root2.Providers;
			IEnumerable<IConfigurationSection> enumerable2 = from key in source2.Aggregate(Enumerable.Empty<string>(), (IEnumerable<string> seed, IConfigurationProvider source) => source.GetChildKeys(seed, path2)).Distinct<string>(StringComparer.OrdinalIgnoreCase)
				select ((IConfiguration)root2).GetSection((path2 == null) ? key : ConfigurationPath.Combine(new string[2] { path2, key }));
			if (referenceCountedProviders == null)
			{
				return enumerable2;
			}
			return enumerable2.ToList();
		}
	}
	public static class MemoryConfigurationBuilderExtensions
	{
		public static IConfigurationBuilder AddInMemoryCollection(this IConfigurationBuilder configurationBuilder)
		{
			System.ThrowHelper.ThrowIfNull(configurationBuilder, "configurationBuilder");
			configurationBuilder.Add((IConfigurationSource)(object)new MemoryConfigurationSource());
			return configurationBuilder;
		}

		public static IConfigurationBuilder AddInMemoryCollection(this IConfigurationBuilder configurationBuilder, IEnumerable<KeyValuePair<string, string?>>? initialData)
		{
			System.ThrowHelper.ThrowIfNull(configurationBuilder, "configurationBuilder");
			configurationBuilder.Add((IConfigurationSource)(object)new MemoryConfigurationSource
			{
				InitialData = initialData
			});
			return configurationBuilder;
		}
	}
	internal abstract class ReferenceCountedProviders : IDisposable
	{
		private sealed class ActiveReferenceCountedProviders : ReferenceCountedProviders
		{
			private long _refCount = 1L;

			private volatile List<IConfigurationProvider> _providers;

			public override List<IConfigurationProvider> Providers
			{
				get
				{
					return _providers;
				}
				set
				{
					_providers = value;
				}
			}

			public override List<IConfigurationProvider> NonReferenceCountedProviders => _providers;

			public ActiveReferenceCountedProviders(List<IConfigurationProvider> providers)
			{
				_providers = providers;
			}

			public override void AddReference()
			{
				Interlocked.Increment(ref _refCount);
			}

			public override void Dispose()
			{
				if (Interlocked.Decrement(ref _refCount) != 0L)
				{
					return;
				}
				foreach (IConfigurationProvider provider in _providers)
				{
					(provider as IDisposable)?.Dispose();
				}
			}
		}

		private sealed class DisposedReferenceCountedProviders : ReferenceCountedProviders
		{
			public override List<IConfigurationProvider> Providers { get; set; }

			public override List<IConfigurationProvider> NonReferenceCountedProviders => Providers;

			public DisposedReferenceCountedProviders(List<IConfigurationProvider> providers)
			{
				Providers = providers;
			}

			public override void AddReference()
			{
			}

			public override void Dispose()
			{
			}
		}

		public abstract List<IConfigurationProvider> Providers { get; set; }

		public abstract List<IConfigurationProvider> NonReferenceCountedProviders { get; }

		public static ReferenceCountedProviders Create(List<IConfigurationProvider> providers)
		{
			return new ActiveReferenceCountedProviders(providers);
		}

		public static ReferenceCountedProviders CreateDisposed(List<IConfigurationProvider> providers)
		{
			return new DisposedReferenceCountedProviders(providers);
		}

		public abstract void AddReference();

		public abstract void Dispose();
	}
	internal sealed class ReferenceCountedProviderManager : IDisposable
	{
		private readonly object _replaceProvidersLock = new object();

		private ReferenceCountedProviders _refCountedProviders = ReferenceCountedProviders.Create(new List<IConfigurationProvider>());

		private bool _disposed;

		public IEnumerable<IConfigurationProvider> NonReferenceCountedProviders => _refCountedProviders.NonReferenceCountedProviders;

		public ReferenceCountedProviders GetReference()
		{
			lock (_replaceProvidersLock)
			{
				if (_disposed)
				{
					return ReferenceCountedProviders.CreateDisposed(_refCountedProviders.NonReferenceCountedProviders);
				}
				_refCountedProviders.AddReference();
				return _refCountedProviders;
			}
		}

		public void ReplaceProviders(List<IConfigurationProvider> providers)
		{
			ReferenceCountedProviders refCountedProviders = _refCountedProviders;
			lock (_replaceProvidersLock)
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("ConfigurationManager");
				}
				_refCountedProviders = ReferenceCountedProviders.Create(providers);
			}
			refCountedProviders.Dispose();
		}

		public void AddProvider(IConfigurationProvider provider)
		{
			lock (_replaceProvidersLock)
			{
				if (_disposed)
				{
					throw new ObjectDisposedException("ConfigurationManager");
				}
				_refCountedProviders.Providers = new List<IConfigurationProvider>(_refCountedProviders.Providers) { provider };
			}
		}

		public void Dispose()
		{
			ReferenceCountedProviders refCountedProviders = _refCountedProviders;
			lock (_replaceProvidersLock)
			{
				_disposed = true;
			}
			refCountedProviders.Dispose();
		}
	}
	public abstract class StreamConfigurationProvider : ConfigurationProvider
	{
		private bool _loaded;

		public StreamConfigurationSource Source { get; }

		public StreamConfigurationProvider(StreamConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			Source = source;
		}

		public abstract void Load(Stream stream);

		public override void Load()
		{
			if (_loaded)
			{
				throw new InvalidOperationException(System.SR.StreamConfigurationProvidersAlreadyLoaded);
			}
			if (Source.Stream == null)
			{
				throw new InvalidOperationException(System.SR.StreamConfigurationSourceStreamCannotBeNull);
			}
			Load(Source.Stream);
			_loaded = true;
		}
	}
	public abstract class StreamConfigurationSource : IConfigurationSource
	{
		public Stream? Stream
		{
			get; [param: DisallowNull]
			set;
		}

		public abstract IConfigurationProvider Build(IConfigurationBuilder builder);
	}
}
namespace Microsoft.Extensions.Configuration.Memory
{
	public class MemoryConfigurationProvider : ConfigurationProvider, IEnumerable<KeyValuePair<string, string?>>, IEnumerable
	{
		private readonly MemoryConfigurationSource _source;

		public MemoryConfigurationProvider(MemoryConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			_source = source;
			if (_source.InitialData == null)
			{
				return;
			}
			foreach (KeyValuePair<string, string> initialDatum in _source.InitialData)
			{
				base.Data.Add(initialDatum.Key, initialDatum.Value);
			}
		}

		public void Add(string key, string? value)
		{
			base.Data.Add(key, value);
		}

		public IEnumerator<KeyValuePair<string, string?>> GetEnumerator()
		{
			return base.Data.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
	public class MemoryConfigurationSource : IConfigurationSource
	{
		public IEnumerable<KeyValuePair<string, string?>>? InitialData { get; set; }

		public IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			return (IConfigurationProvider)(object)new MemoryConfigurationProvider(this);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.EnvironmentVariables.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration.EnvironmentVariables;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.EnvironmentVariables.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.EnvironmentVariables")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.EnvironmentVariables")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class EnvironmentVariablesExtensions
	{
		public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationBuilder configurationBuilder)
		{
			configurationBuilder.Add((IConfigurationSource)(object)new EnvironmentVariablesConfigurationSource());
			return configurationBuilder;
		}

		public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationBuilder configurationBuilder, string? prefix)
		{
			configurationBuilder.Add((IConfigurationSource)(object)new EnvironmentVariablesConfigurationSource
			{
				Prefix = prefix
			});
			return configurationBuilder;
		}

		public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationBuilder builder, Action<EnvironmentVariablesConfigurationSource>? configureSource)
		{
			return ConfigurationExtensions.Add<EnvironmentVariablesConfigurationSource>(builder, configureSource);
		}
	}
}
namespace Microsoft.Extensions.Configuration.EnvironmentVariables
{
	public class EnvironmentVariablesConfigurationProvider : ConfigurationProvider
	{
		private const string MySqlServerPrefix = "MYSQLCONNSTR_";

		private const string SqlAzureServerPrefix = "SQLAZURECONNSTR_";

		private const string SqlServerPrefix = "SQLCONNSTR_";

		private const string CustomConnectionStringPrefix = "CUSTOMCONNSTR_";

		private readonly string _prefix;

		private readonly string _normalizedPrefix;

		public EnvironmentVariablesConfigurationProvider()
		{
			_prefix = string.Empty;
			_normalizedPrefix = string.Empty;
		}

		public EnvironmentVariablesConfigurationProvider(string? prefix)
		{
			_prefix = prefix ?? string.Empty;
			_normalizedPrefix = Normalize(_prefix);
		}

		public override void Load()
		{
			Load(Environment.GetEnvironmentVariables());
		}

		public override string ToString()
		{
			return ((object)this).GetType().Name + " Prefix: '" + _prefix + "'";
		}

		internal void Load(IDictionary envVariables)
		{
			Dictionary<string, string> data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
			IDictionaryEnumerator dictionaryEnumerator = envVariables.GetEnumerator();
			try
			{
				while (dictionaryEnumerator.MoveNext())
				{
					string text = (string)dictionaryEnumerator.Entry.Key;
					string value = (string)dictionaryEnumerator.Entry.Value;
					if (text.StartsWith("MYSQLCONNSTR_", StringComparison.OrdinalIgnoreCase))
					{
						HandleMatchedConnectionStringPrefix(data, "MYSQLCONNSTR_", "MySql.Data.MySqlClient", text, value);
					}
					else if (text.StartsWith("SQLAZURECONNSTR_", StringComparison.OrdinalIgnoreCase))
					{
						HandleMatchedConnectionStringPrefix(data, "SQLAZURECONNSTR_", "System.Data.SqlClient", text, value);
					}
					else if (text.StartsWith("SQLCONNSTR_", StringComparison.OrdinalIgnoreCase))
					{
						HandleMatchedConnectionStringPrefix(data, "SQLCONNSTR_", "System.Data.SqlClient", text, value);
					}
					else if (text.StartsWith("CUSTOMCONNSTR_", StringComparison.OrdinalIgnoreCase))
					{
						HandleMatchedConnectionStringPrefix(data, "CUSTOMCONNSTR_", null, text, value);
					}
					else
					{
						AddIfNormalizedKeyMatchesPrefix(data, Normalize(text), value);
					}
				}
			}
			finally
			{
				IDisposable disposable = dictionaryEnumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			((ConfigurationProvider)this).Data = data;
		}

		private void HandleMatchedConnectionStringPrefix(Dictionary<string, string> data, string connectionStringPrefix, string provider, string fullKey, string value)
		{
			string text = Normalize(fullKey.Substring(connectionStringPrefix.Length));
			AddIfNormalizedKeyMatchesPrefix(data, "ConnectionStrings:" + text, value);
			if (provider != null)
			{
				AddIfNormalizedKeyMatchesPrefix(data, "ConnectionStrings:" + text + "_ProviderName", provider);
			}
		}

		private void AddIfNormalizedKeyMatchesPrefix(Dictionary<string, string> data, string normalizedKey, string value)
		{
			if (normalizedKey.StartsWith(_normalizedPrefix, StringComparison.OrdinalIgnoreCase))
			{
				data[normalizedKey.Substring(_normalizedPrefix.Length)] = value;
			}
		}

		private static string Normalize(string key)
		{
			return key.Replace("__", ConfigurationPath.KeyDelimiter);
		}
	}
	public class EnvironmentVariablesConfigurationSource : IConfigurationSource
	{
		public string? Prefix { get; set; }

		public IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			return (IConfigurationProvider)(object)new EnvironmentVariablesConfigurationProvider(Prefix);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.FileExtensions.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using FxResources.Microsoft.Extensions.Configuration.FileExtensions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Primitives;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.FileExtensions.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.FileExtensions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.FileExtensions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.FileExtensions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_ExpectedPhysicalPath => GetResourceString("Error_ExpectedPhysicalPath");

		internal static string Error_FileNotFound => GetResourceString("Error_FileNotFound");

		internal static string Error_FailedToLoad => GetResourceString("Error_FailedToLoad");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class FileConfigurationExtensions
	{
		private static string FileProviderKey = "FileProvider";

		private static string FileLoadExceptionHandlerKey = "FileLoadExceptionHandler";

		public static IConfigurationBuilder SetFileProvider(this IConfigurationBuilder builder, IFileProvider fileProvider)
		{
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			System.ThrowHelper.ThrowIfNull(fileProvider, "fileProvider");
			builder.Properties[FileProviderKey] = fileProvider;
			return builder;
		}

		public static IFileProvider GetFileProvider(this IConfigurationBuilder builder)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			if (!builder.Properties.TryGetValue(FileProviderKey, out var value))
			{
				return (IFileProvider)new PhysicalFileProvider(AppContext.BaseDirectory ?? string.Empty);
			}
			return (IFileProvider)value;
		}

		public static IConfigurationBuilder SetBasePath(this IConfigurationBuilder builder, string basePath)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			System.ThrowHelper.ThrowIfNull(basePath, "basePath");
			return builder.SetFileProvider((IFileProvider)new PhysicalFileProvider(basePath));
		}

		public static IConfigurationBuilder SetFileLoadExceptionHandler(this IConfigurationBuilder builder, Action<FileLoadExceptionContext> handler)
		{
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			builder.Properties[FileLoadExceptionHandlerKey] = handler;
			return builder;
		}

		public static Action<FileLoadExceptionContext>? GetFileLoadExceptionHandler(this IConfigurationBuilder builder)
		{
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			if (builder.Properties.TryGetValue(FileLoadExceptionHandlerKey, out var value))
			{
				return value as Action<FileLoadExceptionContext>;
			}
			return null;
		}
	}
	public abstract class FileConfigurationProvider : ConfigurationProvider, IDisposable
	{
		private readonly IDisposable _changeTokenRegistration;

		public FileConfigurationSource Source { get; }

		public FileConfigurationProvider(FileConfigurationSource source)
		{
			System.ThrowHelper.ThrowIfNull(source, "source");
			Source = source;
			if (Source.ReloadOnChange && Source.FileProvider != null)
			{
				_changeTokenRegistration = ChangeToken.OnChange((Func<IChangeToken>)(() => Source.FileProvider.Watch(Source.Path)), (Action)delegate
				{
					Thread.Sleep(Source.ReloadDelay);
					Load(reload: true);
				});
			}
		}

		public override string ToString()
		{
			return ((object)this).GetType().Name + " for '" + Source.Path + "' (" + (Source.Optional ? "Optional" : "Required") + ")";
		}

		private void Load(bool reload)
		{
			IFileProvider? fileProvider = Source.FileProvider;
			IFileInfo val = ((fileProvider != null) ? fileProvider.GetFileInfo(Source.Path ?? string.Empty) : null);
			if (val == null || !val.Exists)
			{
				if (Source.Optional || reload)
				{
					((ConfigurationProvider)this).Data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
				}
				else
				{
					StringBuilder stringBuilder = new StringBuilder(System.SR.Format(System.SR.Error_FileNotFound, Source.Path));
					if (!string.IsNullOrEmpty((val != null) ? val.PhysicalPath : null))
					{
						stringBuilder.Append(System.SR.Format(System.SR.Error_ExpectedPhysicalPath, val.PhysicalPath));
					}
					HandleException(ExceptionDispatchInfo.Capture(new FileNotFoundException(stringBuilder.ToString())));
				}
			}
			else
			{
				using Stream stream = OpenRead(val);
				try
				{
					Load(stream);
				}
				catch (Exception innerException)
				{
					if (reload)
					{
						((ConfigurationProvider)this).Data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
					}
					InvalidDataException source = new InvalidDataException(System.SR.Format(System.SR.Error_FailedToLoad, val.PhysicalPath), innerException);
					HandleException(ExceptionDispatchInfo.Capture(source));
				}
			}
			((ConfigurationProvider)this).OnReload();
			static Stream OpenRead(IFileInfo fileInfo)
			{
				if (fileInfo.PhysicalPath != null)
				{
					return new FileStream(fileInfo.PhysicalPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1, FileOptions.SequentialScan);
				}
				return fileInfo.CreateReadStream();
			}
		}

		public override void Load()
		{
			Load(reload: false);
		}

		public abstract void Load(Stream stream);

		private void HandleException(ExceptionDispatchInfo info)
		{
			bool flag = false;
			if (Source.OnLoadException != null)
			{
				FileLoadExceptionContext fileLoadExceptionContext = new FileLoadExceptionContext
				{
					Provider = this,
					Exception = info.SourceException
				};
				Source.OnLoadException(fileLoadExceptionContext);
				flag = fileLoadExceptionContext.Ignore;
			}
			if (!flag)
			{
				info.Throw();
			}
		}

		public void Dispose()
		{
			Dispose(disposing: true);
		}

		protected virtual void Dispose(bool disposing)
		{
			_changeTokenRegistration?.Dispose();
		}
	}
	public abstract class FileConfigurationSource : IConfigurationSource
	{
		public IFileProvider? FileProvider { get; set; }

		public string? Path
		{
			get; [param: DisallowNull]
			set;
		}

		public bool Optional { get; set; }

		public bool ReloadOnChange { get; set; }

		public int ReloadDelay { get; set; } = 250;


		public Action<FileLoadExceptionContext>? OnLoadException { get; set; }

		public abstract IConfigurationProvider Build(IConfigurationBuilder builder);

		public void EnsureDefaults(IConfigurationBuilder builder)
		{
			if (FileProvider == null)
			{
				IFileProvider val = (FileProvider = builder.GetFileProvider());
			}
			if (OnLoadException == null)
			{
				Action<FileLoadExceptionContext> action = (OnLoadException = builder.GetFileLoadExceptionHandler());
			}
		}

		public void ResolveFileProvider()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			if (FileProvider == null && !string.IsNullOrEmpty(Path) && System.IO.Path.IsPathRooted(Path))
			{
				string directoryName = System.IO.Path.GetDirectoryName(Path);
				string text = System.IO.Path.GetFileName(Path);
				while (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName))
				{
					text = System.IO.Path.Combine(System.IO.Path.GetFileName(directoryName), text);
					directoryName = System.IO.Path.GetDirectoryName(directoryName);
				}
				if (Directory.Exists(directoryName))
				{
					FileProvider = (IFileProvider?)new PhysicalFileProvider(directoryName);
					Path = text;
				}
			}
		}
	}
	public class FileLoadExceptionContext
	{
		public FileConfigurationProvider Provider { get; set; }

		public Exception Exception { get; set; }

		public bool Ignore { get; set; }
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.Json.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Json;
using FxResources.Microsoft.Extensions.Configuration.Json;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration.Json;
using Microsoft.Extensions.FileProviders;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.Json")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("JSON configuration provider implementation for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.Json")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("7.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.Json
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_InvalidFilePath => GetResourceString("Error_InvalidFilePath");

		internal static string Error_InvalidTopLevelJSONElement => GetResourceString("Error_InvalidTopLevelJSONElement");

		internal static string Error_JSONParseError => GetResourceString("Error_JSONParseError");

		internal static string Error_KeyIsDuplicated => GetResourceString("Error_KeyIsDuplicated");

		internal static string Error_UnsupportedJSONToken => GetResourceString("Error_UnsupportedJSONToken");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class JsonConfigurationExtensions
	{
		public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, string path)
		{
			return builder.AddJsonFile(null, path, optional: false, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, string path, bool optional)
		{
			return builder.AddJsonFile(null, path, optional, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, string path, bool optional, bool reloadOnChange)
		{
			return builder.AddJsonFile(null, path, optional, reloadOnChange);
		}

		public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, IFileProvider? provider, string path, bool optional, bool reloadOnChange)
		{
			IFileProvider provider2 = provider;
			string path2 = path;
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			if (string.IsNullOrEmpty(path2))
			{
				throw new ArgumentException(System.SR.Error_InvalidFilePath, "path");
			}
			return builder.AddJsonFile(delegate(JsonConfigurationSource s)
			{
				((FileConfigurationSource)s).FileProvider = provider2;
				((FileConfigurationSource)s).Path = path2;
				((FileConfigurationSource)s).Optional = optional;
				((FileConfigurationSource)s).ReloadOnChange = reloadOnChange;
				((FileConfigurationSource)s).ResolveFileProvider();
			});
		}

		public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, Action<JsonConfigurationSource>? configureSource)
		{
			return ConfigurationExtensions.Add<JsonConfigurationSource>(builder, configureSource);
		}

		public static IConfigurationBuilder AddJsonStream(this IConfigurationBuilder builder, Stream stream)
		{
			Stream stream2 = stream;
			System.ThrowHelper.ThrowIfNull(builder, "builder");
			return ConfigurationExtensions.Add<JsonStreamConfigurationSource>(builder, (Action<JsonStreamConfigurationSource>)delegate(JsonStreamConfigurationSource s)
			{
				((StreamConfigurationSource)s).Stream = stream2;
			});
		}
	}
}
namespace Microsoft.Extensions.Configuration.Json
{
	internal sealed class JsonConfigurationFileParser
	{
		private readonly Dictionary<string, string> _data = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

		private readonly Stack<string> _paths = new Stack<string>();

		private JsonConfigurationFileParser()
		{
		}

		public static IDictionary<string, string?> Parse(Stream input)
		{
			return new JsonConfigurationFileParser().ParseStream(input);
		}

		private IDictionary<string, string> ParseStream(Stream input)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			JsonDocumentOptions val = default(JsonDocumentOptions);
			((JsonDocumentOptions)(ref val)).CommentHandling = (JsonCommentHandling)1;
			((JsonDocumentOptions)(ref val)).AllowTrailingCommas = true;
			JsonDocumentOptions val2 = val;
			using (StreamReader streamReader = new StreamReader(input))
			{
				JsonDocument val3 = JsonDocument.Parse(streamReader.ReadToEnd(), val2);
				try
				{
					JsonElement rootElement = val3.RootElement;
					if ((int)((JsonElement)(ref rootElement)).ValueKind != 1)
					{
						string error_InvalidTopLevelJSONElement = System.SR.Error_InvalidTopLevelJSONElement;
						rootElement = val3.RootElement;
						throw new FormatException(System.SR.Format(error_InvalidTopLevelJSONElement, ((JsonElement)(ref rootElement)).ValueKind));
					}
					VisitObjectElement(val3.RootElement);
				}
				finally
				{
					((IDisposable)val3)?.Dispose();
				}
			}
			return _data;
		}

		private void VisitObjectElement(JsonElement element)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			bool nullIfElementIsEmpty = true;
			ObjectEnumerator val = ((JsonElement)(ref element)).EnumerateObject();
			ObjectEnumerator enumerator = ((ObjectEnumerator)(ref val)).GetEnumerator();
			try
			{
				while (((ObjectEnumerator)(ref enumerator)).MoveNext())
				{
					JsonProperty current = ((ObjectEnumerator)(ref enumerator)).Current;
					nullIfElementIsEmpty = false;
					EnterContext(((JsonProperty)(ref current)).Name);
					VisitValue(((JsonProperty)(ref current)).Value);
					ExitContext();
				}
			}
			finally
			{
				((IDisposable)(ObjectEnumerator)(ref enumerator)).Dispose();
			}
			SetNullIfElementIsEmpty(nullIfElementIsEmpty);
		}

		private void VisitArrayElement(JsonElement element)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			ArrayEnumerator val = ((JsonElement)(ref element)).EnumerateArray();
			ArrayEnumerator enumerator = ((ArrayEnumerator)(ref val)).GetEnumerator();
			try
			{
				while (((ArrayEnumerator)(ref enumerator)).MoveNext())
				{
					JsonElement current = ((ArrayEnumerator)(ref enumerator)).Current;
					EnterContext(num.ToString());
					VisitValue(current);
					ExitContext();
					num++;
				}
			}
			finally
			{
				((IDisposable)(ArrayEnumerator)(ref enumerator)).Dispose();
			}
			SetNullIfElementIsEmpty(num == 0);
		}

		private void SetNullIfElementIsEmpty(bool isEmpty)
		{
			if (isEmpty && _paths.Count > 0)
			{
				_data[_paths.Peek()] = null;
			}
		}

		private void VisitValue(JsonElement value)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected I4, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			JsonValueKind valueKind = ((JsonElement)(ref value)).ValueKind;
			switch (valueKind - 1)
			{
			case 0:
				VisitObjectElement(value);
				break;
			case 1:
				VisitArrayElement(value);
				break;
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
			{
				string text = _paths.Peek();
				if (_data.ContainsKey(text))
				{
					throw new FormatException(System.SR.Format(System.SR.Error_KeyIsDuplicated, text));
				}
				_data[text] = ((object)(JsonElement)(ref value)).ToString();
				break;
			}
			default:
				throw new FormatException(System.SR.Format(System.SR.Error_UnsupportedJSONToken, ((JsonElement)(ref value)).ValueKind));
			}
		}

		private void EnterContext(string context)
		{
			_paths.Push((_paths.Count > 0) ? (_paths.Peek() + ConfigurationPath.KeyDelimiter + context) : context);
		}

		private void ExitContext()
		{
			_paths.Pop();
		}
	}
	public class JsonConfigurationProvider : FileConfigurationProvider
	{
		public JsonConfigurationProvider(JsonConfigurationSource source)
			: base((FileConfigurationSource)(object)source)
		{
		}

		public override void Load(Stream stream)
		{
			//IL_000f: Expected O, but got Unknown
			try
			{
				((ConfigurationProvider)this).Data = JsonConfigurationFileParser.Parse(stream);
			}
			catch (JsonException val)
			{
				JsonException innerException = val;
				throw new FormatException(System.SR.Error_JSONParseError, (Exception?)(object)innerException);
			}
		}
	}
	public class JsonConfigurationSource : FileConfigurationSource
	{
		public override IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			((FileConfigurationSource)this).EnsureDefaults(builder);
			return (IConfigurationProvider)(object)new JsonConfigurationProvider(this);
		}
	}
	public class JsonStreamConfigurationProvider : StreamConfigurationProvider
	{
		public JsonStreamConfigurationProvider(JsonStreamConfigurationSource source)
			: base((StreamConfigurationSource)(object)source)
		{
		}

		public override void Load(Stream stream)
		{
			((ConfigurationProvider)this).Data = JsonConfigurationFileParser.Parse(stream);
		}
	}
	public class JsonStreamConfigurationSource : StreamConfigurationSource
	{
		public override IConfigurationProvider Build(IConfigurationBuilder builder)
		{
			return (IConfigurationProvider)(object)new JsonStreamConfigurationProvider(this);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Configuration.UserSecrets.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.Configuration.UserSecrets;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration.UserSecrets;
using Microsoft.Extensions.FileProviders;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.UserSecrets.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Configuration.UserSecrets")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("User secrets configuration provider implementation for Microsoft.Extensions.Configuration.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Configuration.UserSecrets")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Configuration.UserSecrets
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Common_StringNullOrEmpty => GetResourceString("Common_StringNullOrEmpty");

		internal static string Error_Invalid_Character_In_UserSecrets_Id => GetResourceString("Error_Invalid_Character_In_UserSecrets_Id");

		internal static string Error_Missing_UserSecretsIdAttribute => GetResourceString("Error_Missing_UserSecretsIdAttribute");

		internal static string Error_Missing_UserSecretsLocation => GetResourceString("Error_Missing_UserSecretsLocation");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Configuration
{
	public static class UserSecretsConfigurationExtensions
	{
		public static IConfigurationBuilder AddUserSecrets<T>(this IConfigurationBuilder configuration) where T : class
		{
			return configuration.AddUserSecrets(typeof(T).Assembly, optional: true, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddUserSecrets<T>(this IConfigurationBuilder configuration, bool optional) where T : class
		{
			return configuration.AddUserSecrets(typeof(T).Assembly, optional, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddUserSecrets<T>(this IConfigurationBuilder configuration, bool optional, bool reloadOnChange) where T : class
		{
			return configuration.AddUserSecrets(typeof(T).Assembly, optional, reloadOnChange);
		}

		public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, Assembly assembly)
		{
			return configuration.AddUserSecrets(assembly, optional: true, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, Assembly assembly, bool optional)
		{
			return configuration.AddUserSecrets(assembly, optional, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, Assembly assembly, bool optional, bool reloadOnChange)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			System.ThrowHelper.ThrowIfNull(assembly, "assembly");
			UserSecretsIdAttribute customAttribute = assembly.GetCustomAttribute<UserSecretsIdAttribute>();
			if (customAttribute != null)
			{
				return AddUserSecretsInternal(configuration, customAttribute.UserSecretsId, optional, reloadOnChange);
			}
			if (!optional)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.Error_Missing_UserSecretsIdAttribute, assembly.GetName().Name));
			}
			return configuration;
		}

		public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, string userSecretsId)
		{
			return configuration.AddUserSecrets(userSecretsId, reloadOnChange: false);
		}

		public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration, string userSecretsId, bool reloadOnChange)
		{
			return AddUserSecretsInternal(configuration, userSecretsId, optional: true, reloadOnChange);
		}

		private static IConfigurationBuilder AddUserSecretsInternal(IConfigurationBuilder configuration, string userSecretsId, bool optional, bool reloadOnChange)
		{
			System.ThrowHelper.ThrowIfNull(configuration, "configuration");
			System.ThrowHelper.ThrowIfNull(userSecretsId, "userSecretsId");
			return AddSecretsFile(configuration, PathHelper.InternalGetSecretsPathFromSecretsId(userSecretsId, !optional), optional, reloadOnChange);
		}

		private static IConfigurationBuilder AddSecretsFile(IConfigurationBuilder configuration, string secretPath, bool optional, bool reloadOnChange)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(secretPath))
			{
				return configuration;
			}
			string directoryName = Path.GetDirectoryName(secretPath);
			PhysicalFileProvider val = ((!Directory.Exists(directoryName)) ? ((PhysicalFileProvider)null) : new PhysicalFileProvider(directoryName));
			return JsonConfigurationExtensions.AddJsonFile(configuration, (IFileProvider)(object)val, "secrets.json", optional, reloadOnChange);
		}
	}
}
namespace Microsoft.Extensions.Configuration.UserSecrets
{
	public class PathHelper
	{
		internal const string SecretsFileName = "secrets.json";

		public static string GetSecretsPathFromSecretsId(string userSecretsId)
		{
			return InternalGetSecretsPathFromSecretsId(userSecretsId, throwIfNoRoot: true);
		}

		internal static string InternalGetSecretsPathFromSecretsId(string userSecretsId, bool throwIfNoRoot)
		{
			if (string.IsNullOrEmpty(userSecretsId))
			{
				throw new ArgumentException(System.SR.Common_StringNullOrEmpty, "userSecretsId");
			}
			int num = userSecretsId.IndexOfAny(Path.GetInvalidFileNameChars());
			if (num != -1)
			{
				throw new InvalidOperationException(string.Format(System.SR.Error_Invalid_Character_In_UserSecrets_Id, userSecretsId[num], num));
			}
			string environmentVariable = Environment.GetEnvironmentVariable("APPDATA");
			string text = environmentVariable ?? Environment.GetEnvironmentVariable("HOME") ?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) ?? Environment.GetEnvironmentVariable("DOTNET_USER_SECRETS_FALLBACK_DIR");
			if (string.IsNullOrEmpty(text))
			{
				if (throwIfNoRoot)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.Error_Missing_UserSecretsLocation, "DOTNET_USER_SECRETS_FALLBACK_DIR"));
				}
				return string.Empty;
			}
			if (string.IsNullOrEmpty(environmentVariable))
			{
				return Path.Combine(text, ".microsoft", "usersecrets", userSecretsId, "secrets.json");
			}
			return Path.Combine(text, "Microsoft", "UserSecrets", userSecretsId, "secrets.json");
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
	public class UserSecretsIdAttribute : Attribute
	{
		public string UserSecretsId { get; }

		public UserSecretsIdAttribute(string userSecretId)
		{
			if (string.IsNullOrEmpty(userSecretId))
			{
				throw new ArgumentException(System.SR.Common_StringNullOrEmpty, "userSecretId");
			}
			UserSecretsId = userSecretId;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.DependencyInjection.Abstractions.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.DependencyInjection.Abstractions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Internal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyInjection.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.DependencyInjection.Abstractions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Abstractions for dependency injection.\r\n\r\nCommonly Used Types:\r\nMicrosoft.Extensions.DependencyInjection.IServiceCollection")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.DependencyInjection.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.DependencyInjection.Abstractions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string AmbiguousConstructorMatch => GetResourceString("AmbiguousConstructorMatch");

		internal static string CannotResolveService => GetResourceString("CannotResolveService");

		internal static string NoConstructorMatch => GetResourceString("NoConstructorMatch");

		internal static string NoServiceRegistered => GetResourceString("NoServiceRegistered");

		internal static string ServiceCollectionReadOnly => GetResourceString("ServiceCollectionReadOnly");

		internal static string TryAddIndistinguishableTypeToEnumerable => GetResourceString("TryAddIndistinguishableTypeToEnumerable");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string? Scope { get; set; }

		public string? Target { get; set; }

		public string? MessageId { get; set; }

		public string? Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Internal
{
	internal static class ParameterDefaultValue
	{
		public static bool TryGetDefaultValue(ParameterInfo parameter, out object? defaultValue)
		{
			bool tryToGetDefaultValue;
			bool flag = CheckHasDefaultValue(parameter, out tryToGetDefaultValue);
			defaultValue = null;
			if (flag)
			{
				if (tryToGetDefaultValue)
				{
					defaultValue = parameter.DefaultValue;
				}
				bool flag2 = parameter.ParameterType.IsGenericType && parameter.ParameterType.GetGenericTypeDefinition() == typeof(Nullable<>);
				if (defaultValue == null && parameter.ParameterType.IsValueType && !flag2)
				{
					defaultValue = CreateValueType(parameter.ParameterType);
				}
				if (defaultValue != null && flag2)
				{
					Type underlyingType = Nullable.GetUnderlyingType(parameter.ParameterType);
					if (underlyingType != null && underlyingType.IsEnum)
					{
						defaultValue = Enum.ToObject(underlyingType, defaultValue);
					}
				}
			}
			return flag;
			[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern", Justification = "CreateValueType is only called on a ValueType. You can always create an instance of a ValueType.")]
			static object? CreateValueType(Type t)
			{
				return FormatterServices.GetUninitializedObject(t);
			}
		}

		public static bool CheckHasDefaultValue(ParameterInfo parameter, out bool tryToGetDefaultValue)
		{
			tryToGetDefaultValue = true;
			try
			{
				return parameter.HasDefaultValue;
			}
			catch (FormatException) when (parameter.ParameterType == typeof(DateTime))
			{
				tryToGetDefaultValue = false;
				return true;
			}
		}
	}
}
namespace Microsoft.Extensions.DependencyInjection
{
	public static class ActivatorUtilities
	{
		private struct ConstructorMatcher
		{
			private readonly ConstructorInfo _constructor;

			private readonly ParameterInfo[] _parameters;

			private readonly object[] _parameterValues;

			public ConstructorMatcher(ConstructorInfo constructor)
			{
				_constructor = constructor;
				_parameters = _constructor.GetParameters();
				_parameterValues = new object[_parameters.Length];
			}

			public int Match(object[] givenParameters)
			{
				int num = 0;
				int result = 0;
				for (int i = 0; i != givenParameters.Length; i++)
				{
					Type c = givenParameters[i]?.GetType();
					bool flag = false;
					int num2 = num;
					while (!flag && num2 != _parameters.Length)
					{
						if (_parameterValues[num2] == null && _parameters[num2].ParameterType.IsAssignableFrom(c))
						{
							flag = true;
							_parameterValues[num2] = givenParameters[i];
							if (num == num2)
							{
								num++;
								if (num2 == i)
								{
									result = num2;
								}
							}
						}
						num2++;
					}
					if (!flag)
					{
						return -1;
					}
				}
				return result;
			}

			public object CreateInstance(IServiceProvider provider)
			{
				for (int i = 0; i != _parameters.Length; i++)
				{
					if (_parameterValues[i] != null)
					{
						continue;
					}
					object service = provider.GetService(_parameters[i].ParameterType);
					if (service == null)
					{
						if (!ParameterDefaultValue.TryGetDefaultValue(_parameters[i], out object defaultValue))
						{
							throw new InvalidOperationException($"Unable to resolve service for type '{_parameters[i].ParameterType}' while attempting to activate '{_constructor.DeclaringType}'.");
						}
						_parameterValues[i] = defaultValue;
					}
					else
					{
						_parameterValues[i] = service;
					}
				}
				try
				{
					return _constructor.Invoke(_parameterValues);
				}
				catch (TargetInvocationException ex) when (ex.InnerException != null)
				{
					ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
					throw;
				}
			}
		}

		private static readonly MethodInfo GetServiceInfo = GetMethodInfo<Func<IServiceProvider, Type, Type, bool, object>>((IServiceProvider sp, Type t, Type r, bool c) => GetService(sp, t, r, c));

		public static object CreateInstance(IServiceProvider provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, params object[] parameters)
		{
			int num = -1;
			bool flag = false;
			ConstructorMatcher constructorMatcher = default(ConstructorMatcher);
			if (!instanceType.IsAbstract)
			{
				ConstructorInfo[] constructors = instanceType.GetConstructors();
				foreach (ConstructorInfo constructorInfo in constructors)
				{
					ConstructorMatcher constructorMatcher2 = new ConstructorMatcher(constructorInfo);
					bool flag2 = constructorInfo.IsDefined(typeof(ActivatorUtilitiesConstructorAttribute), inherit: false);
					int num2 = constructorMatcher2.Match(parameters);
					if (flag2)
					{
						if (flag)
						{
							ThrowMultipleCtorsMarkedWithAttributeException();
						}
						if (num2 == -1)
						{
							ThrowMarkedCtorDoesNotTakeAllProvidedArguments();
						}
					}
					if (flag2 || num < num2)
					{
						num = num2;
						constructorMatcher = constructorMatcher2;
					}
					flag = flag || flag2;
				}
			}
			if (num == -1)
			{
				string message = $"A suitable constructor for type '{instanceType}' could not be located. Ensure the type is concrete and all parameters of a public constructor are either registered as services or passed as arguments. Also ensure no extraneous arguments are provided.";
				throw new InvalidOperationException(message);
			}
			return constructorMatcher.CreateInstance(provider);
		}

		public static ObjectFactory CreateFactory([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes)
		{
			FindApplicableConstructor(instanceType, argumentTypes, out var matchingConstructor, out var matchingParameterMap);
			ParameterExpression parameterExpression = Expression.Parameter(typeof(IServiceProvider), "provider");
			ParameterExpression parameterExpression2 = Expression.Parameter(typeof(object[]), "argumentArray");
			Expression body = BuildFactoryExpression(matchingConstructor, matchingParameterMap, parameterExpression, parameterExpression2);
			Expression<Func<IServiceProvider, object[], object>> expression = Expression.Lambda<Func<IServiceProvider, object[], object>>(body, new ParameterExpression[2] { parameterExpression, parameterExpression2 });
			Func<IServiceProvider, object[], object> @object = expression.Compile();
			return @object.Invoke;
		}

		public static T CreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider, params object[] parameters)
		{
			return (T)CreateInstance(provider, typeof(T), parameters);
		}

		public static T GetServiceOrCreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider)
		{
			return (T)GetServiceOrCreateInstance(provider, typeof(T));
		}

		public static object GetServiceOrCreateInstance(IServiceProvider provider, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type)
		{
			return provider.GetService(type) ?? CreateInstance(provider, type);
		}

		private static MethodInfo GetMethodInfo<T>(Expression<T> expr)
		{
			MethodCallExpression methodCallExpression = (MethodCallExpression)expr.Body;
			return methodCallExpression.Method;
		}

		private static object GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)
		{
			object service = sp.GetService(type);
			if (service == null && !isDefaultParameterRequired)
			{
				string message = $"Unable to resolve service for type '{type}' while attempting to activate '{requiredBy}'.";
				throw new InvalidOperationException(message);
			}
			return service;
		}

		private static Expression BuildFactoryExpression(ConstructorInfo constructor, int?[] parameterMap, Expression serviceProvider, Expression factoryArgumentArray)
		{
			ParameterInfo[] parameters = constructor.GetParameters();
			Expression[] array = new Expression[parameters.Length];
			for (int i = 0; i < parameters.Length; i++)
			{
				ParameterInfo parameterInfo = parameters[i];
				Type parameterType = parameterInfo.ParameterType;
				object defaultValue;
				bool flag = ParameterDefaultValue.TryGetDefaultValue(parameterInfo, out defaultValue);
				if (parameterMap[i].HasValue)
				{
					array[i] = Expression.ArrayAccess(factoryArgumentArray, Expression.Constant(parameterMap[i]));
				}
				else
				{
					Expression[] arguments = new Expression[4]
					{
						serviceProvider,
						Expression.Constant(parameterType, typeof(Type)),
						Expression.Constant(constructor.DeclaringType, typeof(Type)),
						Expression.Constant(flag)
					};
					array[i] = Expression.Call(GetServiceInfo, arguments);
				}
				if (flag)
				{
					ConstantExpression right = Expression.Constant(defaultValue);
					array[i] = Expression.Coalesce(array[i], right);
				}
				array[i] = Expression.Convert(array[i], parameterType);
			}
			return Expression.New(constructor, array);
		}

		private static void FindApplicableConstructor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes, out ConstructorInfo matchingConstructor, out int?[] matchingParameterMap)
		{
			ConstructorInfo matchingConstructor2 = null;
			int?[] parameterMap = null;
			if (!TryFindPreferredConstructor(instanceType, argumentTypes, ref matchingConstructor2, ref parameterMap) && !TryFindMatchingConstructor(instanceType, argumentTypes, ref matchingConstructor2, ref parameterMap))
			{
				string message = $"A suitable constructor for type '{instanceType}' could not be located. Ensure the type is concrete and all parameters of a public constructor are either registered as services or passed as arguments. Also ensure no extraneous arguments are provided.";
				throw new InvalidOperationException(message);
			}
			matchingConstructor = matchingConstructor2;
			matchingParameterMap = parameterMap;
		}

		private static bool TryFindMatchingConstructor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes, [NotNullWhen(true)] ref ConstructorInfo matchingConstructor, [NotNullWhen(true)] ref int?[] parameterMap)
		{
			ConstructorInfo[] constructors = instanceType.GetConstructors();
			foreach (ConstructorInfo constructorInfo in constructors)
			{
				if (TryCreateParameterMap(constructorInfo.GetParameters(), argumentTypes, out var parameterMap2))
				{
					if (matchingConstructor != null)
					{
						throw new InvalidOperationException($"Multiple constructors accepting all given argument types have been found in type '{instanceType}'. There should only be one applicable constructor.");
					}
					matchingConstructor = constructorInfo;
					parameterMap = parameterMap2;
				}
			}
			if (matchingConstructor != null)
			{
				return true;
			}
			return false;
		}

		private static bool TryFindPreferredConstructor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type instanceType, Type[] argumentTypes, [NotNullWhen(true)] ref ConstructorInfo matchingConstructor, [NotNullWhen(true)] ref int?[] parameterMap)
		{
			bool flag = false;
			ConstructorInfo[] constructors = instanceType.GetConstructors();
			foreach (ConstructorInfo constructorInfo in constructors)
			{
				if (constructorInfo.IsDefined(typeof(ActivatorUtilitiesConstructorAttribute), inherit: false))
				{
					if (flag)
					{
						ThrowMultipleCtorsMarkedWithAttributeException();
					}
					if (!TryCreateParameterMap(constructorInfo.GetParameters(), argumentTypes, out var parameterMap2))
					{
						ThrowMarkedCtorDoesNotTakeAllProvidedArguments();
					}
					matchingConstructor = constructorInfo;
					parameterMap = parameterMap2;
					flag = true;
				}
			}
			if (matchingConstructor != null)
			{
				return true;
			}
			return false;
		}

		private static bool TryCreateParameterMap(ParameterInfo[] constructorParameters, Type[] argumentTypes, out int?[] parameterMap)
		{
			parameterMap = new int?[constructorParameters.Length];
			for (int i = 0; i < argumentTypes.Length; i++)
			{
				bool flag = false;
				Type c = argumentTypes[i];
				for (int j = 0; j < constructorParameters.Length; j++)
				{
					if (!parameterMap[j].HasValue && constructorParameters[j].ParameterType.IsAssignableFrom(c))
					{
						flag = true;
						parameterMap[j] = i;
						break;
					}
				}
				if (!flag)
				{
					return false;
				}
			}
			return true;
		}

		private static void ThrowMultipleCtorsMarkedWithAttributeException()
		{
			throw new InvalidOperationException("Multiple constructors were marked with ActivatorUtilitiesConstructorAttribute.");
		}

		private static void ThrowMarkedCtorDoesNotTakeAllProvidedArguments()
		{
			throw new InvalidOperationException("Constructor marked with ActivatorUtilitiesConstructorAttribute does not accept all given argument types.");
		}
	}
	[AttributeUsage(AttributeTargets.All)]
	public class ActivatorUtilitiesConstructorAttribute : Attribute
	{
	}
	public readonly struct AsyncServiceScope : IServiceScope, IDisposable, IAsyncDisposable
	{
		private readonly IServiceScope _serviceScope;

		public IServiceProvider ServiceProvider => _serviceScope.ServiceProvider;

		public AsyncServiceScope(IServiceScope serviceScope)
		{
			System.ThrowHelper.ThrowIfNull(serviceScope, "serviceScope");
			_serviceScope = serviceScope;
		}

		public void Dispose()
		{
			_serviceScope.Dispose();
		}

		public ValueTask DisposeAsync()
		{
			if (_serviceScope is IAsyncDisposable asyncDisposable)
			{
				return asyncDisposable.DisposeAsync();
			}
			_serviceScope.Dispose();
			return default(ValueTask);
		}
	}
	public interface IServiceCollection : IList<ServiceDescriptor>, ICollection<ServiceDescriptor>, IEnumerable<ServiceDescriptor>, IEnumerable
	{
	}
	public interface IServiceProviderFactory<TContainerBuilder> where TContainerBuilder : notnull
	{
		TContainerBuilder CreateBuilder(IServiceCollection services);

		IServiceProvider CreateServiceProvider(TContainerBuilder containerBuilder);
	}
	public interface IServiceProviderIsService
	{
		bool IsService(Type serviceType);
	}
	public interface IServiceScope : IDisposable
	{
		IServiceProvider ServiceProvider { get; }
	}
	public interface IServiceScopeFactory
	{
		IServiceScope CreateScope();
	}
	public interface ISupportRequiredService
	{
		object GetRequiredService(Type serviceType);
	}
	public delegate object ObjectFactory(IServiceProvider serviceProvider, object?[]? arguments);
	public class ServiceCollection : IServiceCollection, IList<ServiceDescriptor>, ICollection<ServiceDescriptor>, IEnumerable<ServiceDescriptor>, IEnumerable
	{
		private readonly List<ServiceDescriptor> _descriptors = new List<ServiceDescriptor>();

		private bool _isReadOnly;

		public int Count => _descriptors.Count;

		public bool IsReadOnly => _isReadOnly;

		public ServiceDescriptor this[int index]
		{
			get
			{
				return _descriptors[index];
			}
			set
			{
				CheckReadOnly();
				_descriptors[index] = value;
			}
		}

		public void Clear()
		{
			CheckReadOnly();
			_descriptors.Clear();
		}

		public bool Contains(ServiceDescriptor item)
		{
			return _descriptors.Contains(item);
		}

		public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
		{
			_descriptors.CopyTo(array, arrayIndex);
		}

		public bool Remove(ServiceDescriptor item)
		{
			CheckReadOnly();
			return _descriptors.Remove(item);
		}

		public IEnumerator<ServiceDescriptor> GetEnumerator()
		{
			return _descriptors.GetEnumerator();
		}

		void ICollection<ServiceDescriptor>.Add(ServiceDescriptor item)
		{
			CheckReadOnly();
			_descriptors.Add(item);
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		public int IndexOf(ServiceDescriptor item)
		{
			return _descriptors.IndexOf(item);
		}

		public void Insert(int index, ServiceDescriptor item)
		{
			CheckReadOnly();
			_descriptors.Insert(index, item);
		}

		public void RemoveAt(int index)
		{
			CheckReadOnly();
			_descriptors.RemoveAt(index);
		}

		public void MakeReadOnly()
		{
			_isReadOnly = true;
		}

		private void CheckReadOnly()
		{
			if (_isReadOnly)
			{
				ThrowReadOnlyException();
			}
		}

		private static void ThrowReadOnlyException()
		{
			throw new InvalidOperationException(System.SR.ServiceCollectionReadOnly);
		}
	}
	public static class ServiceCollectionServiceExtensions
	{
		public static IServiceCollection AddTransient(this IServiceCollection services, Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			return Add(services, serviceType, implementationType, ServiceLifetime.Transient);
		}

		public static IServiceCollection AddTransient(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Add(services, serviceType, implementationFactory, ServiceLifetime.Transient);
		}

		public static IServiceCollection AddTransient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection services) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddTransient(typeof(TService), typeof(TImplementation));
		}

		public static IServiceCollection AddTransient(this IServiceCollection services, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			return services.AddTransient(serviceType, serviceType);
		}

		public static IServiceCollection AddTransient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection services) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddTransient(typeof(TService));
		}

		public static IServiceCollection AddTransient<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddTransient(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddTransient<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddTransient(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddScoped(this IServiceCollection services, Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			return Add(services, serviceType, implementationType, ServiceLifetime.Scoped);
		}

		public static IServiceCollection AddScoped(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Add(services, serviceType, implementationFactory, ServiceLifetime.Scoped);
		}

		public static IServiceCollection AddScoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection services) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddScoped(typeof(TService), typeof(TImplementation));
		}

		public static IServiceCollection AddScoped(this IServiceCollection services, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			return services.AddScoped(serviceType, serviceType);
		}

		public static IServiceCollection AddScoped<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection services) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddScoped(typeof(TService));
		}

		public static IServiceCollection AddScoped<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddScoped(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddScoped<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddScoped(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddSingleton(this IServiceCollection services, Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			return Add(services, serviceType, implementationType, ServiceLifetime.Singleton);
		}

		public static IServiceCollection AddSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Add(services, serviceType, implementationFactory, ServiceLifetime.Singleton);
		}

		public static IServiceCollection AddSingleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection services) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddSingleton(typeof(TService), typeof(TImplementation));
		}

		public static IServiceCollection AddSingleton(this IServiceCollection services, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			return services.AddSingleton(serviceType, serviceType);
		}

		public static IServiceCollection AddSingleton<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection services) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			return services.AddSingleton(typeof(TService));
		}

		public static IServiceCollection AddSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddSingleton(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddSingleton<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return services.AddSingleton(typeof(TService), implementationFactory);
		}

		public static IServiceCollection AddSingleton(this IServiceCollection services, Type serviceType, object implementationInstance)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationInstance, "implementationInstance");
			ServiceDescriptor item = new ServiceDescriptor(serviceType, implementationInstance);
			services.Add(item);
			return services;
		}

		public static IServiceCollection AddSingleton<TService>(this IServiceCollection services, TService implementationInstance) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(implementationInstance, "implementationInstance");
			return services.AddSingleton(typeof(TService), implementationInstance);
		}

		private static IServiceCollection Add(IServiceCollection collection, Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, ServiceLifetime lifetime)
		{
			ServiceDescriptor item = new ServiceDescriptor(serviceType, implementationType, lifetime);
			collection.Add(item);
			return collection;
		}

		private static IServiceCollection Add(IServiceCollection collection, Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
		{
			ServiceDescriptor item = new ServiceDescriptor(serviceType, implementationFactory, lifetime);
			collection.Add(item);
			return collection;
		}
	}
	[DebuggerDisplay("Lifetime = {Lifetime}, ServiceType = {ServiceType}, ImplementationType = {ImplementationType}")]
	public class ServiceDescriptor
	{
		public ServiceLifetime Lifetime { get; }

		public Type ServiceType { get; }

		[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
		public Type? ImplementationType { get; }

		public object? ImplementationInstance { get; }

		public Func<IServiceProvider, object>? ImplementationFactory { get; }

		public ServiceDescriptor(Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, ServiceLifetime lifetime)
			: this(serviceType, lifetime)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			ImplementationType = implementationType;
		}

		public ServiceDescriptor(Type serviceType, object instance)
			: this(serviceType, ServiceLifetime.Singleton)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(instance, "instance");
			ImplementationInstance = instance;
		}

		public ServiceDescriptor(Type serviceType, Func<IServiceProvider, object> factory, ServiceLifetime lifetime)
			: this(serviceType, lifetime)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			ImplementationFactory = factory;
		}

		private ServiceDescriptor(Type serviceType, ServiceLifetime lifetime)
		{
			Lifetime = lifetime;
			ServiceType = serviceType;
		}

		public override string ToString()
		{
			string text = string.Format("{0}: {1} {2}: {3} ", "ServiceType", ServiceType, "Lifetime", Lifetime);
			if (ImplementationType != null)
			{
				return text + string.Format("{0}: {1}", "ImplementationType", ImplementationType);
			}
			if (ImplementationFactory != null)
			{
				return text + string.Format("{0}: {1}", "ImplementationFactory", ImplementationFactory.Method);
			}
			return text + string.Format("{0}: {1}", "ImplementationInstance", ImplementationInstance);
		}

		internal Type GetImplementationType()
		{
			if (ImplementationType != null)
			{
				return ImplementationType;
			}
			if (ImplementationInstance != null)
			{
				return ImplementationInstance.GetType();
			}
			if (ImplementationFactory != null)
			{
				Type[] genericTypeArguments = ImplementationFactory.GetType().GenericTypeArguments;
				return genericTypeArguments[1];
			}
			return null;
		}

		public static ServiceDescriptor Transient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() where TService : class where TImplementation : class, TService
		{
			return Describe<TService, TImplementation>(ServiceLifetime.Transient);
		}

		public static ServiceDescriptor Transient(Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			return Describe(service, implementationType, ServiceLifetime.Transient);
		}

		public static ServiceDescriptor Transient<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Transient);
		}

		public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Transient);
		}

		public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(service, implementationFactory, ServiceLifetime.Transient);
		}

		public static ServiceDescriptor Scoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() where TService : class where TImplementation : class, TService
		{
			return Describe<TService, TImplementation>(ServiceLifetime.Scoped);
		}

		public static ServiceDescriptor Scoped(Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			return Describe(service, implementationType, ServiceLifetime.Scoped);
		}

		public static ServiceDescriptor Scoped<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Scoped);
		}

		public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Scoped);
		}

		public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(service, implementationFactory, ServiceLifetime.Scoped);
		}

		public static ServiceDescriptor Singleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>() where TService : class where TImplementation : class, TService
		{
			return Describe<TService, TImplementation>(ServiceLifetime.Singleton);
		}

		public static ServiceDescriptor Singleton(Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			return Describe(service, implementationType, ServiceLifetime.Singleton);
		}

		public static ServiceDescriptor Singleton<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Singleton);
		}

		public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(typeof(TService), implementationFactory, ServiceLifetime.Singleton);
		}

		public static ServiceDescriptor Singleton(Type serviceType, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			return Describe(serviceType, implementationFactory, ServiceLifetime.Singleton);
		}

		public static ServiceDescriptor Singleton<TService>(TService implementationInstance) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(implementationInstance, "implementationInstance");
			return Singleton(typeof(TService), implementationInstance);
		}

		public static ServiceDescriptor Singleton(Type serviceType, object implementationInstance)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			System.ThrowHelper.ThrowIfNull(implementationInstance, "implementationInstance");
			return new ServiceDescriptor(serviceType, implementationInstance);
		}

		private static ServiceDescriptor Describe<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(ServiceLifetime lifetime) where TService : class where TImplementation : class, TService
		{
			return Describe(typeof(TService), typeof(TImplementation), lifetime);
		}

		public static ServiceDescriptor Describe(Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, ServiceLifetime lifetime)
		{
			return new ServiceDescriptor(serviceType, implementationType, lifetime);
		}

		public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
		{
			return new ServiceDescriptor(serviceType, implementationFactory, lifetime);
		}
	}
	public enum ServiceLifetime
	{
		Singleton,
		Scoped,
		Transient
	}
	public static class ServiceProviderServiceExtensions
	{
		public static T? GetService<T>(this IServiceProvider provider)
		{
			System.ThrowHelper.ThrowIfNull(provider, "provider");
			return (T)provider.GetService(typeof(T));
		}

		public static object GetRequiredService(this IServiceProvider provider, Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(provider, "provider");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			if (provider is ISupportRequiredService supportRequiredService)
			{
				return supportRequiredService.GetRequiredService(serviceType);
			}
			object service = provider.GetService(serviceType);
			if (service == null)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.NoServiceRegistered, serviceType));
			}
			return service;
		}

		public static T GetRequiredService<T>(this IServiceProvider provider) where T : notnull
		{
			System.ThrowHelper.ThrowIfNull(provider, "provider");
			return (T)provider.GetRequiredService(typeof(T));
		}

		public static IEnumerable<T> GetServices<T>(this IServiceProvider provider)
		{
			System.ThrowHelper.ThrowIfNull(provider, "provider");
			return provider.GetRequiredService<IEnumerable<T>>();
		}

		[RequiresDynamicCode("The native code for an IEnumerable<serviceType> might not be available at runtime.")]
		public static IEnumerable<object?> GetServices(this IServiceProvider provider, Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(provider, "provider");
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			Type serviceType2 = typeof(IEnumerable<>).MakeGenericType(serviceType);
			return (IEnumerable<object>)provider.GetRequiredService(serviceType2);
		}

		public static IServiceScope CreateScope(this IServiceProvider provider)
		{
			return provider.GetRequiredService<IServiceScopeFactory>().CreateScope();
		}

		public static AsyncServiceScope CreateAsyncScope(this IServiceProvider provider)
		{
			return new AsyncServiceScope(provider.CreateScope());
		}

		public static AsyncServiceScope CreateAsyncScope(this IServiceScopeFactory serviceScopeFactory)
		{
			return new AsyncServiceScope(serviceScopeFactory.CreateScope());
		}
	}
}
namespace Microsoft.Extensions.DependencyInjection.Extensions
{
	public static class ServiceCollectionDescriptorExtensions
	{
		public static IServiceCollection Add(this IServiceCollection collection, ServiceDescriptor descriptor)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(descriptor, "descriptor");
			collection.Add(descriptor);
			return collection;
		}

		public static IServiceCollection Add(this IServiceCollection collection, IEnumerable<ServiceDescriptor> descriptors)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(descriptors, "descriptors");
			foreach (ServiceDescriptor descriptor in descriptors)
			{
				collection.Add(descriptor);
			}
			return collection;
		}

		public static void TryAdd(this IServiceCollection collection, ServiceDescriptor descriptor)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(descriptor, "descriptor");
			int count = collection.Count;
			for (int i = 0; i < count; i++)
			{
				if (collection[i].ServiceType == descriptor.ServiceType)
				{
					return;
				}
			}
			collection.Add(descriptor);
		}

		public static void TryAdd(this IServiceCollection collection, IEnumerable<ServiceDescriptor> descriptors)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(descriptors, "descriptors");
			foreach (ServiceDescriptor descriptor in descriptors)
			{
				collection.TryAdd(descriptor);
			}
		}

		public static void TryAddTransient(this IServiceCollection collection, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			ServiceDescriptor descriptor = ServiceDescriptor.Transient(service, service);
			collection.TryAdd(descriptor);
		}

		public static void TryAddTransient(this IServiceCollection collection, Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			ServiceDescriptor descriptor = ServiceDescriptor.Transient(service, implementationType);
			collection.TryAdd(descriptor);
		}

		public static void TryAddTransient(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			ServiceDescriptor descriptor = ServiceDescriptor.Transient(service, implementationFactory);
			collection.TryAdd(descriptor);
		}

		public static void TryAddTransient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection collection) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddTransient(typeof(TService), typeof(TService));
		}

		public static void TryAddTransient<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection collection) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddTransient(typeof(TService), typeof(TImplementation));
		}

		public static void TryAddTransient<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			services.TryAdd(ServiceDescriptor.Transient(implementationFactory));
		}

		public static void TryAddScoped(this IServiceCollection collection, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			ServiceDescriptor descriptor = ServiceDescriptor.Scoped(service, service);
			collection.TryAdd(descriptor);
		}

		public static void TryAddScoped(this IServiceCollection collection, Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			ServiceDescriptor descriptor = ServiceDescriptor.Scoped(service, implementationType);
			collection.TryAdd(descriptor);
		}

		public static void TryAddScoped(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			ServiceDescriptor descriptor = ServiceDescriptor.Scoped(service, implementationFactory);
			collection.TryAdd(descriptor);
		}

		public static void TryAddScoped<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection collection) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddScoped(typeof(TService), typeof(TService));
		}

		public static void TryAddScoped<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection collection) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddScoped(typeof(TService), typeof(TImplementation));
		}

		public static void TryAddScoped<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			services.TryAdd(ServiceDescriptor.Scoped(implementationFactory));
		}

		public static void TryAddSingleton(this IServiceCollection collection, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type service)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			ServiceDescriptor descriptor = ServiceDescriptor.Singleton(service, service);
			collection.TryAdd(descriptor);
		}

		public static void TryAddSingleton(this IServiceCollection collection, Type service, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationType, "implementationType");
			ServiceDescriptor descriptor = ServiceDescriptor.Singleton(service, implementationType);
			collection.TryAdd(descriptor);
		}

		public static void TryAddSingleton(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(service, "service");
			System.ThrowHelper.ThrowIfNull(implementationFactory, "implementationFactory");
			ServiceDescriptor descriptor = ServiceDescriptor.Singleton(service, implementationFactory);
			collection.TryAdd(descriptor);
		}

		public static void TryAddSingleton<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection collection) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddSingleton(typeof(TService), typeof(TService));
		}

		public static void TryAddSingleton<TService, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(this IServiceCollection collection) where TService : class where TImplementation : class, TService
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			collection.TryAddSingleton(typeof(TService), typeof(TImplementation));
		}

		public static void TryAddSingleton<TService>(this IServiceCollection collection, TService instance) where TService : class
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(instance, "instance");
			ServiceDescriptor descriptor = ServiceDescriptor.Singleton(typeof(TService), instance);
			collection.TryAdd(descriptor);
		}

		public static void TryAddSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory) where TService : class
		{
			services.TryAdd(ServiceDescriptor.Singleton(implementationFactory));
		}

		public static void TryAddEnumerable(this IServiceCollection services, ServiceDescriptor descriptor)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(descriptor, "descriptor");
			Type implementationType = descriptor.GetImplementationType();
			if (implementationType == typeof(object) || implementationType == descriptor.ServiceType)
			{
				throw new ArgumentException(System.SR.Format(System.SR.TryAddIndistinguishableTypeToEnumerable, implementationType, descriptor.ServiceType), "descriptor");
			}
			int count = services.Count;
			for (int i = 0; i < count; i++)
			{
				ServiceDescriptor serviceDescriptor = services[i];
				if (serviceDescriptor.ServiceType == descriptor.ServiceType && serviceDescriptor.GetImplementationType() == implementationType)
				{
					return;
				}
			}
			services.Add(descriptor);
		}

		public static void TryAddEnumerable(this IServiceCollection services, IEnumerable<ServiceDescriptor> descriptors)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(descriptors, "descriptors");
			foreach (ServiceDescriptor descriptor in descriptors)
			{
				services.TryAddEnumerable(descriptor);
			}
		}

		public static IServiceCollection Replace(this IServiceCollection collection, ServiceDescriptor descriptor)
		{
			System.ThrowHelper.ThrowIfNull(collection, "collection");
			System.ThrowHelper.ThrowIfNull(descriptor, "descriptor");
			int count = collection.Count;
			for (int i = 0; i < count; i++)
			{
				if (collection[i].ServiceType == descriptor.ServiceType)
				{
					collection.RemoveAt(i);
					break;
				}
			}
			collection.Add(descriptor);
			return collection;
		}

		public static IServiceCollection RemoveAll<T>(this IServiceCollection collection)
		{
			return collection.RemoveAll(typeof(T));
		}

		public static IServiceCollection RemoveAll(this IServiceCollection collection, Type serviceType)
		{
			System.ThrowHelper.ThrowIfNull(serviceType, "serviceType");
			for (int num = collection.Count - 1; num >= 0; num--)
			{
				ServiceDescriptor serviceDescriptor = collection[num];
				if (serviceDescriptor.ServiceType == serviceType)
				{
					collection.RemoveAt(num);
				}
			}
			return collection;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.DependencyInjection.dll

Decompiled a year ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Tracing;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.DependencyInjection;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.ServiceLookup;
using Microsoft.Extensions.Internal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyInjection.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("MicroBenchmarks, PublicKey=00240000048000009400000006020000002400005253413100040000010001004b86c4cb78549b34bab61a3b1800e23bfeb5b3ec390074041536a7e3cbd97f5f04cf0f857155a8928eaa29ebfd11cfbbad3ba70efea7bda3226c6a8d370a4cd303f714486b6ebc225985a638471e6ef571cc92a4613c00b8fa65d61ccee0cbe5f36330c9a01f4183559f1bef24cc2917c6d913e3a541333a1d05d9bed22b38cb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.DependencyInjection")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Default implementation of dependency injection for Microsoft.Extensions.DependencyInjection.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.DependencyInjection")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[assembly: TypeForwardedTo(typeof(ServiceCollection))]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.DependencyInjection
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string AmbiguousConstructorException => GetResourceString("AmbiguousConstructorException");

		internal static string CannotResolveService => GetResourceString("CannotResolveService");

		internal static string CircularDependencyException => GetResourceString("CircularDependencyException");

		internal static string UnableToActivateTypeException => GetResourceString("UnableToActivateTypeException");

		internal static string OpenGenericServiceRequiresOpenGenericImplementation => GetResourceString("OpenGenericServiceRequiresOpenGenericImplementation");

		internal static string ArityOfOpenGenericServiceNotEqualArityOfOpenGenericImplementation => GetResourceString("ArityOfOpenGenericServiceNotEqualArityOfOpenGenericImplementation");

		internal static string TypeCannotBeActivated => GetResourceString("TypeCannotBeActivated");

		internal static string NoConstructorMatch => GetResourceString("NoConstructorMatch");

		internal static string ScopedInSingletonException => GetResourceString("ScopedInSingletonException");

		internal static string ScopedResolvedFromRootException => GetResourceString("ScopedResolvedFromRootException");

		internal static string DirectScopedResolvedFromRootException => GetResourceString("DirectScopedResolvedFromRootException");

		internal static string ConstantCantBeConvertedToServiceType => GetResourceString("ConstantCantBeConvertedToServiceType");

		internal static string ImplementationTypeCantBeConvertedToServiceType => GetResourceString("ImplementationTypeCantBeConvertedToServiceType");

		internal static string AsyncDisposableServiceDispose => GetResourceString("AsyncDisposableServiceDispose");

		internal static string GetCaptureDisposableNotSupported => GetResourceString("GetCaptureDisposableNotSupported");

		internal static string InvalidServiceDescriptor => GetResourceString("InvalidServiceDescriptor");

		internal static string ServiceDescriptorNotExist => GetResourceString("ServiceDescriptorNotExist");

		internal static string CallSiteTypeNotSupported => GetResourceString("CallSiteTypeNotSupported");

		internal static string TrimmingAnnotationsDoNotMatch => GetResourceString("TrimmingAnnotationsDoNotMatch");

		internal static string TrimmingAnnotationsDoNotMatch_NewConstraint => GetResourceString("TrimmingAnnotationsDoNotMatch_NewConstraint");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string? Scope { get; set; }

		public string? Target { get; set; }

		public string? MessageId { get; set; }

		public string? Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace Microsoft.Extensions.DependencyInjection
{
	internal sealed class CallSiteJsonFormatter : CallSiteVisitor<CallSiteJsonFormatter.CallSiteFormatterContext, object?>
	{
		internal struct CallSiteFormatterContext
		{
			private readonly HashSet<ServiceCallSite> _processedCallSites;

			private bool _firstItem;

			public int Offset { get; }

			public StringBuilder Builder { get; }

			public CallSiteFormatterContext(StringBuilder builder, int offset, HashSet<ServiceCallSite> processedCallSites)
			{
				Builder = builder;
				Offset = offset;
				_processedCallSites = processedCallSites;
				_firstItem = true;
			}

			public bool ShouldFormat(ServiceCallSite serviceCallSite)
			{
				return _processedCallSites.Add(serviceCallSite);
			}

			public CallSiteFormatterContext IncrementOffset()
			{
				CallSiteFormatterContext result = new CallSiteFormatterContext(Builder, Offset + 4, _processedCallSites);
				result._firstItem = true;
				return result;
			}

			public CallSiteFormatterContext StartObject()
			{
				Builder.Append('{');
				return IncrementOffset();
			}

			public void EndObject()
			{
				Builder.Append('}');
			}

			public void StartProperty(string name)
			{
				if (!_firstItem)
				{
					Builder.Append(',');
				}
				else
				{
					_firstItem = false;
				}
				Builder.AppendFormat("\"{0}\":", name);
			}

			public void StartArrayItem()
			{
				if (!_firstItem)
				{
					Builder.Append(',');
				}
				else
				{
					_firstItem = false;
				}
			}

			public void WriteProperty(string name, object? value)
			{
				StartProperty(name);
				if (value != null)
				{
					Builder.AppendFormat(" \"{0}\"", value);
				}
				else
				{
					Builder.Append("null");
				}
			}

			public CallSiteFormatterContext StartArray()
			{
				Builder.Append('[');
				return IncrementOffset();
			}

			public void EndArray()
			{
				Builder.Append(']');
			}
		}

		internal static CallSiteJsonFormatter Instance = new CallSiteJsonFormatter();

		private CallSiteJsonFormatter()
		{
		}

		public string Format(ServiceCallSite callSite)
		{
			StringBuilder stringBuilder = new StringBuilder();
			CallSiteFormatterContext argument = new CallSiteFormatterContext(stringBuilder, 0, new HashSet<ServiceCallSite>());
			VisitCallSite(callSite, argument);
			return stringBuilder.ToString();
		}

		protected override object? VisitConstructor(ConstructorCallSite constructorCallSite, CallSiteFormatterContext argument)
		{
			argument.WriteProperty("implementationType", constructorCallSite.ImplementationType);
			if (constructorCallSite.ParameterCallSites.Length != 0)
			{
				argument.StartProperty("arguments");
				CallSiteFormatterContext argument2 = argument.StartArray();
				ServiceCallSite[] parameterCallSites = constructorCallSite.ParameterCallSites;
				foreach (ServiceCallSite callSite in parameterCallSites)
				{
					argument2.StartArrayItem();
					VisitCallSite(callSite, argument2);
				}
				argument.EndArray();
			}
			return null;
		}

		protected override object? VisitCallSiteMain(ServiceCallSite callSite, CallSiteFormatterContext argument)
		{
			if (argument.ShouldFormat(callSite))
			{
				CallSiteFormatterContext argument2 = argument.StartObject();
				argument2.WriteProperty("serviceType", callSite.ServiceType);
				argument2.WriteProperty("kind", callSite.Kind);
				argument2.WriteProperty("cache", callSite.Cache.Location);
				base.VisitCallSiteMain(callSite, argument2);
				argument.EndObject();
			}
			else
			{
				argument.StartObject().WriteProperty("ref", callSite.ServiceType);
				argument.EndObject();
			}
			return null;
		}

		protected override object? VisitConstant(ConstantCallSite constantCallSite, CallSiteFormatterContext argument)
		{
			argument.WriteProperty("value", constantCallSite.DefaultValue ?? "");
			return null;
		}

		protected override object? VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, CallSiteFormatterContext argument)
		{
			return null;
		}

		protected override object? VisitIEnumerable(IEnumerableCallSite enumerableCallSite, CallSiteFormatterContext argument)
		{
			argument.WriteProperty("itemType", enumerableCallSite.ItemType);
			argument.WriteProperty("size", enumerableCallSite.ServiceCallSites.Length);
			if (enumerableCallSite.ServiceCallSites.Length != 0)
			{
				argument.StartProperty("items");
				CallSiteFormatterContext argument2 = argument.StartArray();
				ServiceCallSite[] serviceCallSites = enumerableCallSite.ServiceCallSites;
				foreach (ServiceCallSite callSite in serviceCallSites)
				{
					argument2.StartArrayItem();
					VisitCallSite(callSite, argument2);
				}
				argument.EndArray();
			}
			return null;
		}

		protected override object? VisitFactory(FactoryCallSite factoryCallSite, CallSiteFormatterContext argument)
		{
			argument.WriteProperty("method", factoryCallSite.Factory.Method);
			return null;
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	public class DefaultServiceProviderFactory : IServiceProviderFactory<IServiceCollection>
	{
		private readonly ServiceProviderOptions _options;

		public DefaultServiceProviderFactory()
			: this(ServiceProviderOptions.Default)
		{
		}

		public DefaultServiceProviderFactory(ServiceProviderOptions options)
		{
			_options = options ?? throw new ArgumentNullException("options");
		}

		public IServiceCollection CreateBuilder(IServiceCollection services)
		{
			return services;
		}

		public IServiceProvider CreateServiceProvider(IServiceCollection containerBuilder)
		{
			return containerBuilder.BuildServiceProvider(_options);
		}
	}
	[EventSource(Name = "Microsoft-Extensions-DependencyInjection")]
	internal sealed class DependencyInjectionEventSource : EventSource
	{
		public static class Keywords
		{
			public const EventKeywords ServiceProviderInitialized = (EventKeywords)1L;
		}

		public static readonly DependencyInjectionEventSource Log = new DependencyInjectionEventSource();

		private const int MaxChunkSize = 10240;

		private readonly List<WeakReference<ServiceProvider>> _providers = new List<WeakReference<ServiceProvider>>();

		private DependencyInjectionEventSource()
			: base(EventSourceSettings.EtwSelfDescribingEventFormat)
		{
		}

		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Parameters to this method are primitive and are trimmer safe.")]
		[Event(1, Level = EventLevel.Verbose)]
		private void CallSiteBuilt(string serviceType, string callSite, int chunkIndex, int chunkCount, int serviceProviderHashCode)
		{
			WriteEvent(1, serviceType, callSite, chunkIndex, chunkCount, serviceProviderHashCode);
		}

		[Event(2, Level = EventLevel.Verbose)]
		public void ServiceResolved(string serviceType, int serviceProviderHashCode)
		{
			WriteEvent(2, serviceType, serviceProviderHashCode);
		}

		[Event(3, Level = EventLevel.Verbose)]
		public void ExpressionTreeGenerated(string serviceType, int nodeCount, int serviceProviderHashCode)
		{
			WriteEvent(3, serviceType, nodeCount, serviceProviderHashCode);
		}

		[Event(4, Level = EventLevel.Verbose)]
		public void DynamicMethodBuilt(string serviceType, int methodSize, int serviceProviderHashCode)
		{
			WriteEvent(4, serviceType, methodSize, serviceProviderHashCode);
		}

		[Event(5, Level = EventLevel.Verbose)]
		public void ScopeDisposed(int serviceProviderHashCode, int scopedServicesResolved, int disposableServices)
		{
			WriteEvent(5, serviceProviderHashCode, scopedServicesResolved, disposableServices);
		}

		[Event(6, Level = EventLevel.Error)]
		public void ServiceRealizationFailed(string? exceptionMessage, int serviceProviderHashCode)
		{
			WriteEvent(6, exceptionMessage, serviceProviderHashCode);
		}

		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Parameters to this method are primitive and are trimmer safe.")]
		[Event(7, Level = EventLevel.Informational, Keywords = (EventKeywords)1L)]
		private void ServiceProviderBuilt(int serviceProviderHashCode, int singletonServices, int scopedServices, int transientServices, int closedGenericsServices, int openGenericsServices)
		{
			WriteEvent(7, serviceProviderHashCode, singletonServices, scopedServices, transientServices, closedGenericsServices, openGenericsServices);
		}

		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Parameters to this method are primitive and are trimmer safe.")]
		[Event(8, Level = EventLevel.Informational, Keywords = (EventKeywords)1L)]
		private void ServiceProviderDescriptors(int serviceProviderHashCode, string descriptors, int chunkIndex, int chunkCount)
		{
			WriteEvent(8, serviceProviderHashCode, descriptors, chunkIndex, chunkCount);
		}

		[NonEvent]
		public void ServiceResolved(ServiceProvider provider, Type serviceType)
		{
			if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
			{
				ServiceResolved(serviceType.ToString(), provider.GetHashCode());
			}
		}

		[NonEvent]
		public void CallSiteBuilt(ServiceProvider provider, Type serviceType, ServiceCallSite callSite)
		{
			if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
			{
				string text = CallSiteJsonFormatter.Instance.Format(callSite);
				int num = text.Length / 10240 + ((text.Length % 10240 > 0) ? 1 : 0);
				int hashCode = provider.GetHashCode();
				for (int i = 0; i < num; i++)
				{
					CallSiteBuilt(serviceType.ToString(), text.Substring(i * 10240, Math.Min(10240, text.Length - i * 10240)), i, num, hashCode);
				}
			}
		}

		[NonEvent]
		public void DynamicMethodBuilt(ServiceProvider provider, Type serviceType, int methodSize)
		{
			if (IsEnabled(EventLevel.Verbose, EventKeywords.All))
			{
				DynamicMethodBuilt(serviceType.ToString(), methodSize, provider.GetHashCode());
			}
		}

		[NonEvent]
		public void ServiceRealizationFailed(Exception exception, int serviceProviderHashCode)
		{
			if (IsEnabled(EventLevel.Error, EventKeywords.All))
			{
				ServiceRealizationFailed(exception.ToString(), serviceProviderHashCode);
			}
		}

		[NonEvent]
		public void ServiceProviderBuilt(ServiceProvider provider)
		{
			lock (_providers)
			{
				_providers.Add(new WeakReference<ServiceProvider>(provider));
			}
			WriteServiceProviderBuilt(provider);
		}

		[NonEvent]
		public void ServiceProviderDisposed(ServiceProvider provider)
		{
			lock (_providers)
			{
				for (int num = _providers.Count - 1; num >= 0; num--)
				{
					WeakReference<ServiceProvider> weakReference = _providers[num];
					if (!weakReference.TryGetTarget(out var target) || target == provider)
					{
						_providers.RemoveAt(num);
					}
				}
			}
		}

		[NonEvent]
		private void WriteServiceProviderBuilt(ServiceProvider provider)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected I4, but got Unknown
			if (!IsEnabled(EventLevel.Informational, (EventKeywords)1L))
			{
				return;
			}
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = 0;
			int num5 = 0;
			StringBuilder stringBuilder = new StringBuilder("{ \"descriptors\":[ ");
			bool flag = true;
			ServiceDescriptor[] descriptors = provider.CallSiteFactory.Descriptors;
			foreach (ServiceDescriptor val in descriptors)
			{
				if (flag)
				{
					flag = false;
				}
				else
				{
					stringBuilder.Append(", ");
				}
				AppendServiceDescriptor(stringBuilder, val);
				ServiceLifetime lifetime = val.Lifetime;
				switch ((int)lifetime)
				{
				case 0:
					num++;
					break;
				case 1:
					num2++;
					break;
				case 2:
					num3++;
					break;
				}
				if (val.ServiceType.IsGenericType)
				{
					if (val.ServiceType.IsConstructedGenericType)
					{
						num4++;
					}
					else
					{
						num5++;
					}
				}
			}
			stringBuilder.Append(" ] }");
			int hashCode = provider.GetHashCode();
			ServiceProviderBuilt(hashCode, num, num2, num3, num4, num5);
			string text = stringBuilder.ToString();
			int num6 = text.Length / 10240 + ((text.Length % 10240 > 0) ? 1 : 0);
			for (int j = 0; j < num6; j++)
			{
				ServiceProviderDescriptors(hashCode, text.Substring(j * 10240, Math.Min(10240, text.Length - j * 10240)), j, num6);
			}
		}

		[NonEvent]
		private static void AppendServiceDescriptor(StringBuilder builder, ServiceDescriptor descriptor)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			builder.Append("{ \"serviceType\": \"");
			builder.Append(descriptor.ServiceType);
			builder.Append("\", \"lifetime\": \"");
			builder.Append(descriptor.Lifetime);
			builder.Append("\", ");
			if ((object)descriptor.ImplementationType != null)
			{
				builder.Append("\"implementationType\": \"");
				builder.Append(descriptor.ImplementationType);
			}
			else if (descriptor.ImplementationFactory != null)
			{
				builder.Append("\"implementationFactory\": \"");
				builder.Append(descriptor.ImplementationFactory.Method);
			}
			else if (descriptor.ImplementationInstance != null)
			{
				builder.Append("\"implementationInstance\": \"");
				builder.Append(descriptor.ImplementationInstance.GetType());
				builder.Append(" (instance)");
			}
			else
			{
				builder.Append("\"unknown\": \"");
			}
			builder.Append("\" }");
		}

		protected override void OnEventCommand(EventCommandEventArgs command)
		{
			if (command.Command != EventCommand.Enable)
			{
				return;
			}
			lock (_providers)
			{
				foreach (WeakReference<ServiceProvider> provider in _providers)
				{
					if (provider.TryGetTarget(out var target))
					{
						WriteServiceProviderBuilt(target);
					}
				}
			}
		}
	}
	internal static class DependencyInjectionEventSourceExtensions
	{
		private sealed class NodeCountingVisitor : ExpressionVisitor
		{
			public int NodeCount { get; private set; }

			[return: NotNullIfNotNull("e")]
			public override Expression Visit(Expression e)
			{
				base.Visit(e);
				NodeCount++;
				return e;
			}
		}

		public static void ExpressionTreeGenerated(this DependencyInjectionEventSource source, ServiceProvider provider, Type serviceType, Expression expression)
		{
			if (source.IsEnabled(EventLevel.Verbose, EventKeywords.All))
			{
				NodeCountingVisitor nodeCountingVisitor = new NodeCountingVisitor();
				nodeCountingVisitor.Visit(expression);
				source.ExpressionTreeGenerated(serviceType.ToString(), nodeCountingVisitor.NodeCount, provider.GetHashCode());
			}
		}
	}
	public static class ServiceCollectionContainerBuilderExtensions
	{
		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		public static ServiceProvider BuildServiceProvider(this IServiceCollection services)
		{
			return services.BuildServiceProvider(ServiceProviderOptions.Default);
		}

		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		public static ServiceProvider BuildServiceProvider(this IServiceCollection services, bool validateScopes)
		{
			return services.BuildServiceProvider(new ServiceProviderOptions
			{
				ValidateScopes = validateScopes
			});
		}

		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		public static ServiceProvider BuildServiceProvider(this IServiceCollection services, ServiceProviderOptions options)
		{
			if (services == null)
			{
				throw new ArgumentNullException("services");
			}
			if (options == null)
			{
				throw new ArgumentNullException("options");
			}
			return new ServiceProvider((ICollection<ServiceDescriptor>)services, options);
		}
	}
	public sealed class ServiceProvider : IServiceProvider, IDisposable, IAsyncDisposable
	{
		internal const string RequiresDynamicCodeMessage = "Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.";

		private readonly CallSiteValidator _callSiteValidator;

		private readonly Func<Type, Func<ServiceProviderEngineScope, object>> _createServiceAccessor;

		internal ServiceProviderEngine _engine;

		private bool _disposed;

		private ConcurrentDictionary<Type, Func<ServiceProviderEngineScope, object>> _realizedServices;

		internal CallSiteFactory CallSiteFactory { get; }

		internal ServiceProviderEngineScope Root { get; }

		internal static bool VerifyOpenGenericServiceTrimmability { get; } = AppContext.TryGetSwitch("Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability", out var isEnabled) && isEnabled;


		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		internal ServiceProvider(ICollection<ServiceDescriptor> serviceDescriptors, ServiceProviderOptions options)
		{
			Root = new ServiceProviderEngineScope(this, isRootScope: true);
			_engine = GetEngine();
			_createServiceAccessor = CreateServiceAccessor;
			_realizedServices = new ConcurrentDictionary<Type, Func<ServiceProviderEngineScope, object>>();
			CallSiteFactory = new CallSiteFactory(serviceDescriptors);
			CallSiteFactory.Add(typeof(IServiceProvider), new ServiceProviderCallSite());
			CallSiteFactory.Add(typeof(IServiceScopeFactory), new ConstantCallSite(typeof(IServiceScopeFactory), Root));
			CallSiteFactory.Add(typeof(IServiceProviderIsService), new ConstantCallSite(typeof(IServiceProviderIsService), CallSiteFactory));
			if (options.ValidateScopes)
			{
				_callSiteValidator = new CallSiteValidator();
			}
			if (options.ValidateOnBuild)
			{
				List<Exception> list = null;
				foreach (ServiceDescriptor serviceDescriptor in serviceDescriptors)
				{
					try
					{
						ValidateService(serviceDescriptor);
					}
					catch (Exception item)
					{
						if (list == null)
						{
							list = new List<Exception>();
						}
						list.Add(item);
					}
				}
				if (list != null)
				{
					throw new AggregateException("Some services are not able to be constructed", list.ToArray());
				}
			}
			DependencyInjectionEventSource.Log.ServiceProviderBuilt(this);
		}

		public object? GetService(Type serviceType)
		{
			return GetService(serviceType, Root);
		}

		internal bool IsDisposed()
		{
			return _disposed;
		}

		public void Dispose()
		{
			DisposeCore();
			Root.Dispose();
		}

		public ValueTask DisposeAsync()
		{
			DisposeCore();
			return Root.DisposeAsync();
		}

		private void DisposeCore()
		{
			_disposed = true;
			DependencyInjectionEventSource.Log.ServiceProviderDisposed(this);
		}

		private void OnCreate(ServiceCallSite callSite)
		{
			_callSiteValidator?.ValidateCallSite(callSite);
		}

		private void OnResolve(Type serviceType, IServiceScope scope)
		{
			_callSiteValidator?.ValidateResolution(serviceType, scope, (IServiceScope)(object)Root);
		}

		internal object? GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
		{
			if (_disposed)
			{
				ThrowHelper.ThrowObjectDisposedException();
			}
			Func<ServiceProviderEngineScope, object> orAdd = _realizedServices.GetOrAdd(serviceType, _createServiceAccessor);
			OnResolve(serviceType, (IServiceScope)(object)serviceProviderEngineScope);
			DependencyInjectionEventSource.Log.ServiceResolved(this, serviceType);
			return orAdd(serviceProviderEngineScope);
		}

		private void ValidateService(ServiceDescriptor descriptor)
		{
			if (descriptor.ServiceType.IsGenericType && !descriptor.ServiceType.IsConstructedGenericType)
			{
				return;
			}
			try
			{
				ServiceCallSite callSite = CallSiteFactory.GetCallSite(descriptor, new CallSiteChain());
				if (callSite != null)
				{
					OnCreate(callSite);
				}
			}
			catch (Exception ex)
			{
				throw new InvalidOperationException($"Error while validating the service descriptor '{descriptor}': {ex.Message}", ex);
			}
		}

		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		private Func<ServiceProviderEngineScope, object> CreateServiceAccessor(Type serviceType)
		{
			ServiceCallSite callSite = CallSiteFactory.GetCallSite(serviceType, new CallSiteChain());
			if (callSite != null)
			{
				DependencyInjectionEventSource.Log.CallSiteBuilt(this, serviceType, callSite);
				OnCreate(callSite);
				if (callSite.Cache.Location == CallSiteResultCacheLocation.Root)
				{
					object value = CallSiteRuntimeResolver.Instance.Resolve(callSite, Root);
					return (ServiceProviderEngineScope scope) => value;
				}
				return _engine.RealizeService(callSite);
			}
			return (ServiceProviderEngineScope _) => null;
		}

		internal void ReplaceServiceAccessor(ServiceCallSite callSite, Func<ServiceProviderEngineScope, object?> accessor)
		{
			_realizedServices[callSite.ServiceType] = accessor;
		}

		internal IServiceScope CreateScope()
		{
			if (_disposed)
			{
				ThrowHelper.ThrowObjectDisposedException();
			}
			return (IServiceScope)(object)new ServiceProviderEngineScope(this, isRootScope: false);
		}

		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		private ServiceProviderEngine GetEngine()
		{
			return new DynamicServiceProviderEngine(this);
		}
	}
	public class ServiceProviderOptions
	{
		internal static readonly ServiceProviderOptions Default = new ServiceProviderOptions();

		public bool ValidateScopes { get; set; }

		public bool ValidateOnBuild { get; set; }
	}
}
namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
{
	internal sealed class CallSiteChain
	{
		private readonly struct ChainItemInfo
		{
			public int Order { get; }

			public Type ImplementationType { get; }

			public ChainItemInfo(int order, Type implementationType)
			{
				Order = order;
				ImplementationType = implementationType;
			}
		}

		private readonly Dictionary<Type, ChainItemInfo> _callSiteChain;

		public CallSiteChain()
		{
			_callSiteChain = new Dictionary<Type, ChainItemInfo>();
		}

		public void CheckCircularDependency(Type serviceType)
		{
			if (_callSiteChain.ContainsKey(serviceType))
			{
				throw new InvalidOperationException(CreateCircularDependencyExceptionMessage(serviceType));
			}
		}

		public void Remove(Type serviceType)
		{
			_callSiteChain.Remove(serviceType);
		}

		public void Add(Type serviceType, Type? implementationType = null)
		{
			_callSiteChain[serviceType] = new ChainItemInfo(_callSiteChain.Count, implementationType);
		}

		private string CreateCircularDependencyExceptionMessage(Type type)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(System.SR.Format(System.SR.CircularDependencyException, TypeNameHelper.GetTypeDisplayName(type)));
			stringBuilder.AppendLine();
			AppendResolutionPath(stringBuilder, type);
			return stringBuilder.ToString();
		}

		private void AppendResolutionPath(StringBuilder builder, Type currentlyResolving)
		{
			List<KeyValuePair<Type, ChainItemInfo>> list = new List<KeyValuePair<Type, ChainItemInfo>>(_callSiteChain);
			list.Sort((KeyValuePair<Type, ChainItemInfo> a, KeyValuePair<Type, ChainItemInfo> b) => a.Value.Order.CompareTo(b.Value.Order));
			foreach (KeyValuePair<Type, ChainItemInfo> item in list)
			{
				Type key = item.Key;
				Type implementationType = item.Value.ImplementationType;
				if (implementationType == null || key == implementationType)
				{
					builder.Append(TypeNameHelper.GetTypeDisplayName(key));
				}
				else
				{
					builder.AppendFormat("{0}({1})", TypeNameHelper.GetTypeDisplayName(key), TypeNameHelper.GetTypeDisplayName(implementationType));
				}
				builder.Append(" -> ");
			}
			builder.Append(TypeNameHelper.GetTypeDisplayName(currentlyResolving));
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class CallSiteFactory : IServiceProviderIsService
	{
		private struct ServiceDescriptorCacheItem
		{
			[DisallowNull]
			private ServiceDescriptor _item;

			[DisallowNull]
			private List<ServiceDescriptor> _items;

			public ServiceDescriptor Last
			{
				get
				{
					if (_items != null && _items.Count > 0)
					{
						return _items[_items.Count - 1];
					}
					return _item;
				}
			}

			public int Count
			{
				get
				{
					if (_item == null)
					{
						return 0;
					}
					return 1 + (_items?.Count ?? 0);
				}
			}

			public ServiceDescriptor this[int index]
			{
				get
				{
					if (index >= Count)
					{
						throw new ArgumentOutOfRangeException("index");
					}
					if (index == 0)
					{
						return _item;
					}
					return _items[index - 1];
				}
			}

			public int GetSlot(ServiceDescriptor descriptor)
			{
				if (descriptor == _item)
				{
					return Count - 1;
				}
				if (_items != null)
				{
					int num = _items.IndexOf(descriptor);
					if (num != -1)
					{
						return _items.Count - (num + 1);
					}
				}
				throw new InvalidOperationException(System.SR.ServiceDescriptorNotExist);
			}

			public ServiceDescriptorCacheItem Add(ServiceDescriptor descriptor)
			{
				ServiceDescriptorCacheItem result = default(ServiceDescriptorCacheItem);
				if (_item == null)
				{
					result._item = descriptor;
				}
				else
				{
					result._item = _item;
					result._items = _items ?? new List<ServiceDescriptor>();
					result._items.Add(descriptor);
				}
				return result;
			}
		}

		private const int DefaultSlot = 0;

		private readonly ServiceDescriptor[] _descriptors;

		private readonly ConcurrentDictionary<ServiceCacheKey, ServiceCallSite> _callSiteCache = new ConcurrentDictionary<ServiceCacheKey, ServiceCallSite>();

		private readonly Dictionary<Type, ServiceDescriptorCacheItem> _descriptorLookup = new Dictionary<Type, ServiceDescriptorCacheItem>();

		private readonly ConcurrentDictionary<Type, object> _callSiteLocks = new ConcurrentDictionary<Type, object>();

		private readonly StackGuard _stackGuard;

		internal ServiceDescriptor[] Descriptors => _descriptors;

		public CallSiteFactory(ICollection<ServiceDescriptor> descriptors)
		{
			_stackGuard = new StackGuard();
			_descriptors = (ServiceDescriptor[])(object)new ServiceDescriptor[descriptors.Count];
			descriptors.CopyTo(_descriptors, 0);
			Populate();
		}

		private void Populate()
		{
			ServiceDescriptor[] descriptors = _descriptors;
			foreach (ServiceDescriptor val in descriptors)
			{
				Type serviceType = val.ServiceType;
				if (serviceType.IsGenericTypeDefinition)
				{
					Type implementationType = val.ImplementationType;
					if (implementationType == null || !implementationType.IsGenericTypeDefinition)
					{
						throw new ArgumentException(System.SR.Format(System.SR.OpenGenericServiceRequiresOpenGenericImplementation, serviceType), "descriptors");
					}
					if (implementationType.IsAbstract || implementationType.IsInterface)
					{
						throw new ArgumentException(System.SR.Format(System.SR.TypeCannotBeActivated, implementationType, serviceType));
					}
					Type[] genericArguments = serviceType.GetGenericArguments();
					Type[] genericArguments2 = implementationType.GetGenericArguments();
					if (genericArguments.Length != genericArguments2.Length)
					{
						throw new ArgumentException(System.SR.Format(System.SR.ArityOfOpenGenericServiceNotEqualArityOfOpenGenericImplementation, serviceType, implementationType), "descriptors");
					}
					if (ServiceProvider.VerifyOpenGenericServiceTrimmability)
					{
						ValidateTrimmingAnnotations(serviceType, genericArguments, implementationType, genericArguments2);
					}
				}
				else if (val.ImplementationInstance == null && val.ImplementationFactory == null)
				{
					Type implementationType2 = val.ImplementationType;
					if (implementationType2.IsGenericTypeDefinition || implementationType2.IsAbstract || implementationType2.IsInterface)
					{
						throw new ArgumentException(System.SR.Format(System.SR.TypeCannotBeActivated, implementationType2, serviceType));
					}
				}
				Type key = serviceType;
				_descriptorLookup.TryGetValue(key, out var value);
				_descriptorLookup[key] = value.Add(val);
			}
		}

		private static void ValidateTrimmingAnnotations(Type serviceType, Type[] serviceTypeGenericArguments, Type implementationType, Type[] implementationTypeGenericArguments)
		{
			for (int i = 0; i < serviceTypeGenericArguments.Length; i++)
			{
				Type type = serviceTypeGenericArguments[i];
				Type type2 = implementationTypeGenericArguments[i];
				DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes = GetDynamicallyAccessedMemberTypes(type);
				DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes2 = GetDynamicallyAccessedMemberTypes(type2);
				if (!AreCompatible(dynamicallyAccessedMemberTypes, dynamicallyAccessedMemberTypes2))
				{
					throw new ArgumentException(System.SR.Format(System.SR.TrimmingAnnotationsDoNotMatch, implementationType.FullName, serviceType.FullName));
				}
				bool flag = type.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint);
				if (type2.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint) && !flag)
				{
					throw new ArgumentException(System.SR.Format(System.SR.TrimmingAnnotationsDoNotMatch_NewConstraint, implementationType.FullName, serviceType.FullName));
				}
			}
		}

		private static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypes(Type serviceGenericType)
		{
			foreach (CustomAttributeData customAttributesDatum in serviceGenericType.GetCustomAttributesData())
			{
				if (customAttributesDatum.AttributeType.FullName == "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute" && customAttributesDatum.ConstructorArguments.Count == 1 && customAttributesDatum.ConstructorArguments[0].ArgumentType.FullName == "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes")
				{
					return (DynamicallyAccessedMemberTypes)(int)customAttributesDatum.ConstructorArguments[0].Value;
				}
			}
			return DynamicallyAccessedMemberTypes.None;
		}

		private static bool AreCompatible(DynamicallyAccessedMemberTypes serviceDynamicallyAccessedMembers, DynamicallyAccessedMemberTypes implementationDynamicallyAccessedMembers)
		{
			return serviceDynamicallyAccessedMembers.HasFlag(implementationDynamicallyAccessedMembers);
		}

		internal int? GetSlot(ServiceDescriptor serviceDescriptor)
		{
			if (_descriptorLookup.TryGetValue(serviceDescriptor.ServiceType, out var value))
			{
				return value.GetSlot(serviceDescriptor);
			}
			return null;
		}

		internal ServiceCallSite? GetCallSite(Type serviceType, CallSiteChain callSiteChain)
		{
			if (!_callSiteCache.TryGetValue(new ServiceCacheKey(serviceType, 0), out var value))
			{
				return CreateCallSite(serviceType, callSiteChain);
			}
			return value;
		}

		internal ServiceCallSite? GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
		{
			if (_descriptorLookup.TryGetValue(serviceDescriptor.ServiceType, out var value))
			{
				return TryCreateExact(serviceDescriptor, serviceDescriptor.ServiceType, callSiteChain, value.GetSlot(serviceDescriptor));
			}
			return null;
		}

		private ServiceCallSite CreateCallSite(Type serviceType, CallSiteChain callSiteChain)
		{
			if (!_stackGuard.TryEnterOnCurrentStack())
			{
				return _stackGuard.RunOnEmptyStack(CreateCallSite, serviceType, callSiteChain);
			}
			object orAdd = _callSiteLocks.GetOrAdd(serviceType, (Type _) => new object());
			lock (orAdd)
			{
				callSiteChain.CheckCircularDependency(serviceType);
				return TryCreateExact(serviceType, callSiteChain) ?? TryCreateOpenGeneric(serviceType, callSiteChain) ?? TryCreateEnumerable(serviceType, callSiteChain);
			}
		}

		private ServiceCallSite TryCreateExact(Type serviceType, CallSiteChain callSiteChain)
		{
			if (_descriptorLookup.TryGetValue(serviceType, out var value))
			{
				return TryCreateExact(value.Last, serviceType, callSiteChain, 0);
			}
			return null;
		}

		private ServiceCallSite TryCreateOpenGeneric(Type serviceType, CallSiteChain callSiteChain)
		{
			if (serviceType.IsConstructedGenericType && _descriptorLookup.TryGetValue(serviceType.GetGenericTypeDefinition(), out var value))
			{
				return TryCreateOpenGeneric(value.Last, serviceType, callSiteChain, 0, throwOnConstraintViolation: true);
			}
			return null;
		}

		private ServiceCallSite TryCreateEnumerable(Type serviceType, CallSiteChain callSiteChain)
		{
			ServiceCacheKey serviceCacheKey = new ServiceCacheKey(serviceType, 0);
			if (_callSiteCache.TryGetValue(serviceCacheKey, out var value))
			{
				return value;
			}
			ServiceCallSite serviceCallSite4;
			try
			{
				callSiteChain.Add(serviceType);
				if (serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() == typeof(IEnumerable<>))
				{
					Type type = serviceType.GenericTypeArguments[0];
					CallSiteResultCacheLocation callSiteResultCacheLocation = CallSiteResultCacheLocation.Root;
					List<ServiceCallSite> list = new List<ServiceCallSite>();
					if (!type.IsConstructedGenericType && _descriptorLookup.TryGetValue(type, out var value2))
					{
						for (int i = 0; i < value2.Count; i++)
						{
							ServiceDescriptor descriptor = value2[i];
							int slot = value2.Count - i - 1;
							ServiceCallSite serviceCallSite = TryCreateExact(descriptor, type, callSiteChain, slot);
							callSiteResultCacheLocation = GetCommonCacheLocation(callSiteResultCacheLocation, serviceCallSite.Cache.Location);
							list.Add(serviceCallSite);
						}
					}
					else
					{
						int num = 0;
						for (int num2 = _descriptors.Length - 1; num2 >= 0; num2--)
						{
							ServiceDescriptor descriptor2 = _descriptors[num2];
							ServiceCallSite serviceCallSite2 = TryCreateExact(descriptor2, type, callSiteChain, num) ?? TryCreateOpenGeneric(descriptor2, type, callSiteChain, num, throwOnConstraintViolation: false);
							if (serviceCallSite2 != null)
							{
								num++;
								callSiteResultCacheLocation = GetCommonCacheLocation(callSiteResultCacheLocation, serviceCallSite2.Cache.Location);
								list.Add(serviceCallSite2);
							}
						}
						list.Reverse();
					}
					ResultCache cache = ResultCache.None;
					if (callSiteResultCacheLocation == CallSiteResultCacheLocation.Scope || callSiteResultCacheLocation == CallSiteResultCacheLocation.Root)
					{
						cache = new ResultCache(callSiteResultCacheLocation, serviceCacheKey);
					}
					serviceCallSite4 = (_callSiteCache[serviceCacheKey] = new IEnumerableCallSite(cache, type, list.ToArray()));
					serviceCallSite4 = serviceCallSite4;
				}
				else
				{
					serviceCallSite4 = null;
				}
			}
			finally
			{
				callSiteChain.Remove(serviceType);
			}
			return serviceCallSite4;
		}

		private static CallSiteResultCacheLocation GetCommonCacheLocation(CallSiteResultCacheLocation locationA, CallSiteResultCacheLocation locationB)
		{
			return (CallSiteResultCacheLocation)Math.Max((int)locationA, (int)locationB);
		}

		private ServiceCallSite TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, int slot)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (serviceType == descriptor.ServiceType)
			{
				ServiceCacheKey key = new ServiceCacheKey(serviceType, slot);
				if (_callSiteCache.TryGetValue(key, out var value))
				{
					return value;
				}
				ResultCache resultCache = new ResultCache(descriptor.Lifetime, serviceType, slot);
				ServiceCallSite serviceCallSite;
				if (descriptor.ImplementationInstance != null)
				{
					serviceCallSite = new ConstantCallSite(descriptor.ServiceType, descriptor.ImplementationInstance);
				}
				else if (descriptor.ImplementationFactory != null)
				{
					serviceCallSite = new FactoryCallSite(resultCache, descriptor.ServiceType, descriptor.ImplementationFactory);
				}
				else
				{
					if (!(descriptor.ImplementationType != null))
					{
						throw new InvalidOperationException(System.SR.InvalidServiceDescriptor);
					}
					serviceCallSite = CreateConstructorCallSite(resultCache, descriptor.ServiceType, descriptor.ImplementationType, callSiteChain);
				}
				return _callSiteCache[key] = serviceCallSite;
			}
			return null;
		}

		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2055:MakeGenericType", Justification = "MakeGenericType here is used to create a closed generic implementation type given the closed service type. Trimming annotations on the generic types are verified when 'Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability' is set, which is set by default when PublishTrimmed=true. That check informs developers when these generic types don't have compatible trimming annotations.")]
		private ServiceCallSite TryCreateOpenGeneric(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, int slot, bool throwOnConstraintViolation)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (serviceType.IsConstructedGenericType && serviceType.GetGenericTypeDefinition() == descriptor.ServiceType)
			{
				ServiceCacheKey key = new ServiceCacheKey(serviceType, slot);
				if (_callSiteCache.TryGetValue(key, out var value))
				{
					return value;
				}
				ResultCache lifetime = new ResultCache(descriptor.Lifetime, serviceType, slot);
				Type implementationType;
				try
				{
					implementationType = descriptor.ImplementationType.MakeGenericType(serviceType.GenericTypeArguments);
				}
				catch (ArgumentException)
				{
					if (throwOnConstraintViolation)
					{
						throw;
					}
					return null;
				}
				return _callSiteCache[key] = CreateConstructorCallSite(lifetime, serviceType, implementationType, callSiteChain);
			}
			return null;
		}

		private ServiceCallSite CreateConstructorCallSite(ResultCache lifetime, Type serviceType, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type implementationType, CallSiteChain callSiteChain)
		{
			try
			{
				callSiteChain.Add(serviceType, implementationType);
				ConstructorInfo[] constructors = implementationType.GetConstructors();
				ServiceCallSite[] parameterCallSites = null;
				if (constructors.Length == 0)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.NoConstructorMatch, implementationType));
				}
				if (constructors.Length == 1)
				{
					ConstructorInfo constructorInfo = constructors[0];
					ParameterInfo[] parameters = constructorInfo.GetParameters();
					if (parameters.Length == 0)
					{
						return new ConstructorCallSite(lifetime, serviceType, constructorInfo);
					}
					parameterCallSites = CreateArgumentCallSites(implementationType, callSiteChain, parameters, throwIfCallSiteNotFound: true);
					return new ConstructorCallSite(lifetime, serviceType, constructorInfo, parameterCallSites);
				}
				Array.Sort(constructors, (ConstructorInfo a, ConstructorInfo b) => b.GetParameters().Length.CompareTo(a.GetParameters().Length));
				ConstructorInfo constructorInfo2 = null;
				HashSet<Type> hashSet = null;
				for (int i = 0; i < constructors.Length; i++)
				{
					ParameterInfo[] parameters2 = constructors[i].GetParameters();
					ServiceCallSite[] array = CreateArgumentCallSites(implementationType, callSiteChain, parameters2, throwIfCallSiteNotFound: false);
					if (array == null)
					{
						continue;
					}
					if (constructorInfo2 == null)
					{
						constructorInfo2 = constructors[i];
						parameterCallSites = array;
						continue;
					}
					if (hashSet == null)
					{
						hashSet = new HashSet<Type>();
						ParameterInfo[] parameters3 = constructorInfo2.GetParameters();
						foreach (ParameterInfo parameterInfo in parameters3)
						{
							hashSet.Add(parameterInfo.ParameterType);
						}
					}
					ParameterInfo[] array2 = parameters2;
					foreach (ParameterInfo parameterInfo2 in array2)
					{
						if (!hashSet.Contains(parameterInfo2.ParameterType))
						{
							throw new InvalidOperationException(string.Join(Environment.NewLine, System.SR.Format(System.SR.AmbiguousConstructorException, implementationType), constructorInfo2, constructors[i]));
						}
					}
				}
				if (constructorInfo2 == null)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.UnableToActivateTypeException, implementationType));
				}
				return new ConstructorCallSite(lifetime, serviceType, constructorInfo2, parameterCallSites);
			}
			finally
			{
				callSiteChain.Remove(serviceType);
			}
		}

		private ServiceCallSite[] CreateArgumentCallSites(Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, bool throwIfCallSiteNotFound)
		{
			ServiceCallSite[] array = new ServiceCallSite[parameters.Length];
			for (int i = 0; i < parameters.Length; i++)
			{
				Type parameterType = parameters[i].ParameterType;
				ServiceCallSite serviceCallSite = GetCallSite(parameterType, callSiteChain);
				if (serviceCallSite == null && ParameterDefaultValue.TryGetDefaultValue(parameters[i], out object defaultValue))
				{
					serviceCallSite = new ConstantCallSite(parameterType, defaultValue);
				}
				if (serviceCallSite == null)
				{
					if (throwIfCallSiteNotFound)
					{
						throw new InvalidOperationException(System.SR.Format(System.SR.CannotResolveService, parameterType, implementationType));
					}
					return null;
				}
				array[i] = serviceCallSite;
			}
			return array;
		}

		public void Add(Type type, ServiceCallSite serviceCallSite)
		{
			_callSiteCache[new ServiceCacheKey(type, 0)] = serviceCallSite;
		}

		public bool IsService(Type serviceType)
		{
			if ((object)serviceType == null)
			{
				throw new ArgumentNullException("serviceType");
			}
			if (serviceType.IsGenericTypeDefinition)
			{
				return false;
			}
			if (_descriptorLookup.ContainsKey(serviceType))
			{
				return true;
			}
			if (serviceType.IsConstructedGenericType)
			{
				Type genericTypeDefinition = serviceType.GetGenericTypeDefinition();
				if ((object)genericTypeDefinition != null)
				{
					if (!(genericTypeDefinition == typeof(IEnumerable<>)))
					{
						return _descriptorLookup.ContainsKey(genericTypeDefinition);
					}
					return true;
				}
			}
			if (!(serviceType == typeof(IServiceProvider)) && !(serviceType == typeof(IServiceScopeFactory)))
			{
				return serviceType == typeof(IServiceProviderIsService);
			}
			return true;
		}
	}
	internal enum CallSiteKind
	{
		Factory,
		Constructor,
		Constant,
		IEnumerable,
		ServiceProvider
	}
	internal enum CallSiteResultCacheLocation
	{
		Root,
		Scope,
		Dispose,
		None
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class CallSiteRuntimeResolver : CallSiteVisitor<RuntimeResolverContext, object?>
	{
		public static CallSiteRuntimeResolver Instance { get; } = new CallSiteRuntimeResolver();


		private CallSiteRuntimeResolver()
		{
		}

		public object? Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
		{
			if (scope.IsRootScope)
			{
				object value = callSite.Value;
				if (value != null)
				{
					return value;
				}
			}
			return VisitCallSite(callSite, new RuntimeResolverContext
			{
				Scope = scope
			});
		}

		protected override object? VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
		{
			return context.Scope.CaptureDisposable(VisitCallSiteMain(transientCallSite, context));
		}

		protected override object VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
		{
			object[] array;
			if (constructorCallSite.ParameterCallSites.Length == 0)
			{
				array = Array.Empty<object>();
			}
			else
			{
				array = new object[constructorCallSite.ParameterCallSites.Length];
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = VisitCallSite(constructorCallSite.ParameterCallSites[i], context);
				}
			}
			try
			{
				return constructorCallSite.ConstructorInfo.Invoke(array);
			}
			catch (Exception ex) when (ex.InnerException != null)
			{
				ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
				throw;
			}
		}

		protected override object? VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
		{
			object value = callSite.Value;
			if (value != null)
			{
				return value;
			}
			RuntimeResolverLock runtimeResolverLock = RuntimeResolverLock.Root;
			ServiceProviderEngineScope root = context.Scope.RootProvider.Root;
			lock (callSite)
			{
				object value2 = callSite.Value;
				if (value2 != null)
				{
					return value2;
				}
				object obj = VisitCallSiteMain(callSite, new RuntimeResolverContext
				{
					Scope = root,
					AcquiredLocks = (context.AcquiredLocks | runtimeResolverLock)
				});
				root.CaptureDisposable(obj);
				callSite.Value = obj;
				return obj;
			}
		}

		protected override object? VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
		{
			if (!context.Scope.IsRootScope)
			{
				return VisitCache(callSite, context, context.Scope, RuntimeResolverLock.Scope);
			}
			return VisitRootCache(callSite, context);
		}

		private object VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
		{
			bool lockTaken = false;
			object sync = serviceProviderEngine.Sync;
			Dictionary<ServiceCacheKey, object> resolvedServices = serviceProviderEngine.ResolvedServices;
			if ((context.AcquiredLocks & lockType) == 0)
			{
				Monitor.Enter(sync, ref lockTaken);
			}
			try
			{
				if (resolvedServices.TryGetValue(callSite.Cache.Key, out var value))
				{
					return value;
				}
				value = VisitCallSiteMain(callSite, new RuntimeResolverContext
				{
					Scope = serviceProviderEngine,
					AcquiredLocks = (context.AcquiredLocks | lockType)
				});
				serviceProviderEngine.CaptureDisposable(value);
				resolvedServices.Add(callSite.Cache.Key, value);
				return value;
			}
			finally
			{
				if (lockTaken)
				{
					Monitor.Exit(sync);
				}
			}
		}

		protected override object? VisitConstant(ConstantCallSite constantCallSite, RuntimeResolverContext context)
		{
			return constantCallSite.DefaultValue;
		}

		protected override object VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, RuntimeResolverContext context)
		{
			return context.Scope;
		}

		protected override object VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
		{
			Array array = Array.CreateInstance(enumerableCallSite.ItemType, enumerableCallSite.ServiceCallSites.Length);
			for (int i = 0; i < enumerableCallSite.ServiceCallSites.Length; i++)
			{
				object value = VisitCallSite(enumerableCallSite.ServiceCallSites[i], context);
				array.SetValue(value, i);
			}
			return array;
		}

		protected override object VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
		{
			return factoryCallSite.Factory(context.Scope);
		}
	}
	internal struct RuntimeResolverContext
	{
		public ServiceProviderEngineScope Scope { get; set; }

		public RuntimeResolverLock AcquiredLocks { get; set; }
	}
	[Flags]
	internal enum RuntimeResolverLock
	{
		Scope = 1,
		Root = 2
	}
	internal sealed class CallSiteValidator : CallSiteVisitor<CallSiteValidator.CallSiteValidatorState, Type?>
	{
		internal struct CallSiteValidatorState
		{
			public ServiceCallSite? Singleton
			{
				get; [param: DisallowNull]
				set;
			}
		}

		private readonly ConcurrentDictionary<Type, Type> _scopedServices = new ConcurrentDictionary<Type, Type>();

		public void ValidateCallSite(ServiceCallSite callSite)
		{
			Type type = VisitCallSite(callSite, default(CallSiteValidatorState));
			if (type != null)
			{
				_scopedServices[callSite.ServiceType] = type;
			}
		}

		public void ValidateResolution(Type serviceType, IServiceScope scope, IServiceScope rootScope)
		{
			if (scope == rootScope && _scopedServices.TryGetValue(serviceType, out var value))
			{
				if (serviceType == value)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.DirectScopedResolvedFromRootException, serviceType, "Scoped".ToLowerInvariant()));
				}
				throw new InvalidOperationException(System.SR.Format(System.SR.ScopedResolvedFromRootException, serviceType, value, "Scoped".ToLowerInvariant()));
			}
		}

		protected override Type? VisitConstructor(ConstructorCallSite constructorCallSite, CallSiteValidatorState state)
		{
			Type type = null;
			ServiceCallSite[] parameterCallSites = constructorCallSite.ParameterCallSites;
			foreach (ServiceCallSite callSite in parameterCallSites)
			{
				Type type2 = VisitCallSite(callSite, state);
				if ((object)type == null)
				{
					type = type2;
				}
			}
			return type;
		}

		protected override Type? VisitIEnumerable(IEnumerableCallSite enumerableCallSite, CallSiteValidatorState state)
		{
			Type type = null;
			ServiceCallSite[] serviceCallSites = enumerableCallSite.ServiceCallSites;
			foreach (ServiceCallSite callSite in serviceCallSites)
			{
				Type type2 = VisitCallSite(callSite, state);
				if ((object)type == null)
				{
					type = type2;
				}
			}
			return type;
		}

		protected override Type? VisitRootCache(ServiceCallSite singletonCallSite, CallSiteValidatorState state)
		{
			state.Singleton = singletonCallSite;
			return VisitCallSiteMain(singletonCallSite, state);
		}

		protected override Type? VisitScopeCache(ServiceCallSite scopedCallSite, CallSiteValidatorState state)
		{
			if (scopedCallSite.ServiceType == typeof(IServiceScopeFactory))
			{
				return null;
			}
			if (state.Singleton != null)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.ScopedInSingletonException, scopedCallSite.ServiceType, state.Singleton.ServiceType, "Scoped".ToLowerInvariant(), "Singleton".ToLowerInvariant()));
			}
			VisitCallSiteMain(scopedCallSite, state);
			return scopedCallSite.ServiceType;
		}

		protected override Type? VisitConstant(ConstantCallSite constantCallSite, CallSiteValidatorState state)
		{
			return null;
		}

		protected override Type? VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, CallSiteValidatorState state)
		{
			return null;
		}

		protected override Type? VisitFactory(FactoryCallSite factoryCallSite, CallSiteValidatorState state)
		{
			return null;
		}
	}
	internal abstract class CallSiteVisitor<TArgument, TResult>
	{
		private readonly StackGuard _stackGuard;

		protected CallSiteVisitor()
		{
			_stackGuard = new StackGuard();
		}

		protected virtual TResult VisitCallSite(ServiceCallSite callSite, TArgument argument)
		{
			if (!_stackGuard.TryEnterOnCurrentStack())
			{
				return _stackGuard.RunOnEmptyStack(VisitCallSite, callSite, argument);
			}
			return callSite.Cache.Location switch
			{
				CallSiteResultCacheLocation.Root => VisitRootCache(callSite, argument), 
				CallSiteResultCacheLocation.Scope => VisitScopeCache(callSite, argument), 
				CallSiteResultCacheLocation.Dispose => VisitDisposeCache(callSite, argument), 
				CallSiteResultCacheLocation.None => VisitNoCache(callSite, argument), 
				_ => throw new ArgumentOutOfRangeException(), 
			};
		}

		protected virtual TResult VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
		{
			return callSite.Kind switch
			{
				CallSiteKind.Factory => VisitFactory((FactoryCallSite)callSite, argument), 
				CallSiteKind.IEnumerable => VisitIEnumerable((IEnumerableCallSite)callSite, argument), 
				CallSiteKind.Constructor => VisitConstructor((ConstructorCallSite)callSite, argument), 
				CallSiteKind.Constant => VisitConstant((ConstantCallSite)callSite, argument), 
				CallSiteKind.ServiceProvider => VisitServiceProvider((ServiceProviderCallSite)callSite, argument), 
				_ => throw new NotSupportedException(System.SR.Format(System.SR.CallSiteTypeNotSupported, callSite.GetType())), 
			};
		}

		protected virtual TResult VisitNoCache(ServiceCallSite callSite, TArgument argument)
		{
			return VisitCallSiteMain(callSite, argument);
		}

		protected virtual TResult VisitDisposeCache(ServiceCallSite callSite, TArgument argument)
		{
			return VisitCallSiteMain(callSite, argument);
		}

		protected virtual TResult VisitRootCache(ServiceCallSite callSite, TArgument argument)
		{
			return VisitCallSiteMain(callSite, argument);
		}

		protected virtual TResult VisitScopeCache(ServiceCallSite callSite, TArgument argument)
		{
			return VisitCallSiteMain(callSite, argument);
		}

		protected abstract TResult VisitConstructor(ConstructorCallSite constructorCallSite, TArgument argument);

		protected abstract TResult VisitConstant(ConstantCallSite constantCallSite, TArgument argument);

		protected abstract TResult VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, TArgument argument);

		protected abstract TResult VisitIEnumerable(IEnumerableCallSite enumerableCallSite, TArgument argument);

		protected abstract TResult VisitFactory(FactoryCallSite factoryCallSite, TArgument argument);
	}
	internal abstract class CompiledServiceProviderEngine : ServiceProviderEngine
	{
		public ILEmitResolverBuilder ResolverBuilder { get; }

		[RequiresDynamicCode("Creates DynamicMethods")]
		public CompiledServiceProviderEngine(ServiceProvider provider)
		{
			ResolverBuilder = new ILEmitResolverBuilder(provider);
		}

		public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
		{
			return ResolverBuilder.Build(callSite);
		}
	}
	internal sealed class ConstantCallSite : ServiceCallSite
	{
		private readonly Type _serviceType;

		internal object? DefaultValue => base.Value;

		public override Type ServiceType => _serviceType;

		public override Type ImplementationType => DefaultValue?.GetType() ?? _serviceType;

		public override CallSiteKind Kind { get; } = CallSiteKind.Constant;


		public ConstantCallSite(Type serviceType, object? defaultValue)
			: base(ResultCache.None)
		{
			_serviceType = serviceType ?? throw new ArgumentNullException("serviceType");
			if (defaultValue != null && !serviceType.IsInstanceOfType(defaultValue))
			{
				throw new ArgumentException(System.SR.Format(System.SR.ConstantCantBeConvertedToServiceType, defaultValue.GetType(), serviceType));
			}
			base.Value = defaultValue;
		}
	}
	internal sealed class ConstructorCallSite : ServiceCallSite
	{
		internal ConstructorInfo ConstructorInfo { get; }

		internal ServiceCallSite[] ParameterCallSites { get; }

		public override Type ServiceType { get; }

		public override Type? ImplementationType => ConstructorInfo.DeclaringType;

		public override CallSiteKind Kind { get; } = CallSiteKind.Constructor;


		public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo)
			: this(cache, serviceType, constructorInfo, Array.Empty<ServiceCallSite>())
		{
		}

		public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo, ServiceCallSite[] parameterCallSites)
			: base(cache)
		{
			if (!serviceType.IsAssignableFrom(constructorInfo.DeclaringType))
			{
				throw new ArgumentException(System.SR.Format(System.SR.ImplementationTypeCantBeConvertedToServiceType, constructorInfo.DeclaringType, serviceType));
			}
			ServiceType = serviceType;
			ConstructorInfo = constructorInfo;
			ParameterCallSites = parameterCallSites;
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class DynamicServiceProviderEngine : CompiledServiceProviderEngine
	{
		private readonly ServiceProvider _serviceProvider;

		public DynamicServiceProviderEngine(ServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			_serviceProvider = serviceProvider;
		}

		public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
		{
			ServiceCallSite callSite2 = callSite;
			int callCount = 0;
			return delegate(ServiceProviderEngineScope scope)
			{
				object result = CallSiteRuntimeResolver.Instance.Resolve(callSite2, scope);
				if (Interlocked.Increment(ref callCount) == 2)
				{
					ThreadPool.UnsafeQueueUserWorkItem(delegate
					{
						try
						{
							_serviceProvider.ReplaceServiceAccessor(callSite2, base.RealizeService(callSite2));
						}
						catch (Exception exception)
						{
							DependencyInjectionEventSource.Log.ServiceRealizationFailed(exception, _serviceProvider.GetHashCode());
						}
					}, null);
				}
				return result;
			};
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class ExpressionResolverBuilder : CallSiteVisitor<object?, Expression>
	{
		private static readonly ParameterExpression ScopeParameter = Expression.Parameter(typeof(ServiceProviderEngineScope));

		private static readonly ParameterExpression ResolvedServices = Expression.Variable(typeof(IDictionary<ServiceCacheKey, object>), ScopeParameter.Name + "resolvedServices");

		private static readonly ParameterExpression Sync = Expression.Variable(typeof(object), ScopeParameter.Name + "sync");

		private static readonly BinaryExpression ResolvedServicesVariableAssignment = Expression.Assign(ResolvedServices, Expression.Property(ScopeParameter, typeof(ServiceProviderEngineScope).GetProperty("ResolvedServices", BindingFlags.Instance | BindingFlags.NonPublic)));

		private static readonly BinaryExpression SyncVariableAssignment = Expression.Assign(Sync, Expression.Property(ScopeParameter, typeof(ServiceProviderEngineScope).GetProperty("Sync", BindingFlags.Instance | BindingFlags.NonPublic)));

		private static readonly ParameterExpression CaptureDisposableParameter = Expression.Parameter(typeof(object));

		private static readonly LambdaExpression CaptureDisposable = Expression.Lambda(Expression.Call(ScopeParameter, ServiceLookupHelpers.CaptureDisposableMethodInfo, CaptureDisposableParameter), CaptureDisposableParameter);

		private static readonly ConstantExpression CallSiteRuntimeResolverInstanceExpression = Expression.Constant(CallSiteRuntimeResolver.Instance, typeof(CallSiteRuntimeResolver));

		private readonly ServiceProviderEngineScope _rootScope;

		private readonly ConcurrentDictionary<ServiceCacheKey, Func<ServiceProviderEngineScope, object>> _scopeResolverCache;

		private readonly Func<ServiceCacheKey, ServiceCallSite, Func<ServiceProviderEngineScope, object>> _buildTypeDelegate;

		public ExpressionResolverBuilder(ServiceProvider serviceProvider)
		{
			_rootScope = serviceProvider.Root;
			_scopeResolverCache = new ConcurrentDictionary<ServiceCacheKey, Func<ServiceProviderEngineScope, object>>();
			_buildTypeDelegate = (ServiceCacheKey key, ServiceCallSite cs) => BuildNoCache(cs);
		}

		public Func<ServiceProviderEngineScope, object> Build(ServiceCallSite callSite)
		{
			ServiceCallSite callSite2 = callSite;
			if (callSite2.Cache.Location == CallSiteResultCacheLocation.Scope)
			{
				return _scopeResolverCache.GetOrAdd(callSite2.Cache.Key, (ServiceCacheKey key) => _buildTypeDelegate(key, callSite2));
			}
			return BuildNoCache(callSite2);
		}

		public Func<ServiceProviderEngineScope, object> BuildNoCache(ServiceCallSite callSite)
		{
			Expression<Func<ServiceProviderEngineScope, object>> expression = BuildExpression(callSite);
			DependencyInjectionEventSource.Log.ExpressionTreeGenerated(_rootScope.RootProvider, callSite.ServiceType, expression);
			return expression.Compile();
		}

		private Expression<Func<ServiceProviderEngineScope, object>> BuildExpression(ServiceCallSite callSite)
		{
			if (callSite.Cache.Location == CallSiteResultCacheLocation.Scope)
			{
				return Expression.Lambda<Func<ServiceProviderEngineScope, object>>(Expression.Block(new ParameterExpression[2] { ResolvedServices, Sync }, ResolvedServicesVariableAssignment, SyncVariableAssignment, BuildScopedExpression(callSite)), new ParameterExpression[1] { ScopeParameter });
			}
			return Expression.Lambda<Func<ServiceProviderEngineScope, object>>(Convert(VisitCallSite(callSite, null), typeof(object), forceValueTypeConversion: true), new ParameterExpression[1] { ScopeParameter });
		}

		protected override Expression VisitRootCache(ServiceCallSite singletonCallSite, object? context)
		{
			return Expression.Constant(CallSiteRuntimeResolver.Instance.Resolve(singletonCallSite, _rootScope));
		}

		protected override Expression VisitConstant(ConstantCallSite constantCallSite, object? context)
		{
			return Expression.Constant(constantCallSite.DefaultValue);
		}

		protected override Expression VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, object? context)
		{
			return ScopeParameter;
		}

		protected override Expression VisitFactory(FactoryCallSite factoryCallSite, object? context)
		{
			return Expression.Invoke(Expression.Constant(factoryCallSite.Factory), ScopeParameter);
		}

		protected override Expression VisitIEnumerable(IEnumerableCallSite callSite, object? context)
		{
			object context2 = context;
			IEnumerableCallSite callSite2 = callSite;
			if (callSite2.ServiceCallSites.Length == 0)
			{
				return Expression.Constant(ServiceLookupHelpers.GetArrayEmptyMethodInfo(callSite2.ItemType).Invoke(null, Array.Empty<object>()));
			}
			return Expression.NewArrayInit(callSite2.ItemType, callSite2.ServiceCallSites.Select((ServiceCallSite cs) => Convert(VisitCallSite(cs, context2), callSite2.ItemType)));
		}

		protected override Expression VisitDisposeCache(ServiceCallSite callSite, object? context)
		{
			return TryCaptureDisposable(callSite, ScopeParameter, VisitCallSiteMain(callSite, context));
		}

		private static Expression TryCaptureDisposable(ServiceCallSite callSite, ParameterExpression scope, Expression service)
		{
			if (!callSite.CaptureDisposable)
			{
				return service;
			}
			return Expression.Invoke(GetCaptureDisposable(scope), service);
		}

		protected override Expression VisitConstructor(ConstructorCallSite callSite, object? context)
		{
			ParameterInfo[] parameters = callSite.ConstructorInfo.GetParameters();
			Expression[] array;
			if (callSite.ParameterCallSites.Length == 0)
			{
				array = Array.Empty<Expression>();
			}
			else
			{
				array = new Expression[callSite.ParameterCallSites.Length];
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = Convert(VisitCallSite(callSite.ParameterCallSites[i], context), parameters[i].ParameterType);
				}
			}
			Expression expression = Expression.New(callSite.ConstructorInfo, array);
			if (callSite.ImplementationType.IsValueType)
			{
				expression = Expression.Convert(expression, typeof(object));
			}
			return expression;
		}

		private static Expression Convert(Expression expression, Type type, bool forceValueTypeConversion = false)
		{
			if (type.IsAssignableFrom(expression.Type) && (!expression.Type.IsValueType || !forceValueTypeConversion))
			{
				return expression;
			}
			return Expression.Convert(expression, type);
		}

		protected override Expression VisitScopeCache(ServiceCallSite callSite, object? context)
		{
			Func<ServiceProviderEngineScope, object> value = Build(callSite);
			return Expression.Invoke(Expression.Constant(value), ScopeParameter);
		}

		private Expression BuildScopedExpression(ServiceCallSite callSite)
		{
			ConstantExpression arg = Expression.Constant(callSite, typeof(ServiceCallSite));
			MethodCallExpression ifTrue = Expression.Call(CallSiteRuntimeResolverInstanceExpression, ServiceLookupHelpers.ResolveCallSiteAndScopeMethodInfo, arg, ScopeParameter);
			ConstantExpression arg2 = Expression.Constant(callSite.Cache.Key, typeof(ServiceCacheKey));
			ParameterExpression parameterExpression = Expression.Variable(typeof(object), "resolved");
			ParameterExpression resolvedServices = ResolvedServices;
			MethodCallExpression expression = Expression.Call(resolvedServices, ServiceLookupHelpers.TryGetValueMethodInfo, arg2, parameterExpression);
			Expression right = TryCaptureDisposable(callSite, ScopeParameter, VisitCallSiteMain(callSite, null));
			BinaryExpression arg3 = Expression.Assign(parameterExpression, right);
			MethodCallExpression arg4 = Expression.Call(resolvedServices, ServiceLookupHelpers.AddMethodInfo, arg2, parameterExpression);
			BlockExpression arg5 = Expression.Block(typeof(object), new ParameterExpression[1] { parameterExpression }, Expression.IfThen(Expression.Not(expression), Expression.Block(arg3, arg4)), parameterExpression);
			ParameterExpression parameterExpression2 = Expression.Variable(typeof(bool), "lockWasTaken");
			ParameterExpression sync = Sync;
			MethodCallExpression arg6 = Expression.Call(ServiceLookupHelpers.MonitorEnterMethodInfo, sync, parameterExpression2);
			MethodCallExpression ifTrue2 = Expression.Call(ServiceLookupHelpers.MonitorExitMethodInfo, sync);
			BlockExpression body = Expression.Block(arg6, arg5);
			ConditionalExpression @finally = Expression.IfThen(parameterExpression2, ifTrue2);
			return Expression.Condition(Expression.Property(ScopeParameter, typeof(ServiceProviderEngineScope).GetProperty("IsRootScope", BindingFlags.Instance | BindingFlags.Public)), ifTrue, Expression.Block(typeof(object), new ParameterExpression[1] { parameterExpression2 }, Expression.TryFinally(body, @finally)));
		}

		public static Expression GetCaptureDisposable(ParameterExpression scope)
		{
			if (scope != ScopeParameter)
			{
				throw new NotSupportedException(System.SR.GetCaptureDisposableNotSupported);
			}
			return CaptureDisposable;
		}
	}
	internal sealed class ExpressionsServiceProviderEngine : ServiceProviderEngine
	{
		private readonly ExpressionResolverBuilder _expressionResolverBuilder;

		[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
		public ExpressionsServiceProviderEngine(ServiceProvider serviceProvider)
		{
			_expressionResolverBuilder = new ExpressionResolverBuilder(serviceProvider);
		}

		public override Func<ServiceProviderEngineScope, object> RealizeService(ServiceCallSite callSite)
		{
			return _expressionResolverBuilder.Build(callSite);
		}
	}
	internal sealed class FactoryCallSite : ServiceCallSite
	{
		public Func<IServiceProvider, object> Factory { get; }

		public override Type ServiceType { get; }

		public override Type? ImplementationType => null;

		public override CallSiteKind Kind { get; }

		public FactoryCallSite(ResultCache cache, Type serviceType, Func<IServiceProvider, object> factory)
			: base(cache)
		{
			Factory = factory;
			ServiceType = serviceType;
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class IEnumerableCallSite : ServiceCallSite
	{
		internal Type ItemType { get; }

		internal ServiceCallSite[] ServiceCallSites { get; }

		public override Type ServiceType => typeof(IEnumerable<>).MakeGenericType(ItemType);

		public override Type ImplementationType => ItemType.MakeArrayType();

		public override CallSiteKind Kind { get; } = CallSiteKind.IEnumerable;


		public IEnumerableCallSite(ResultCache cache, Type itemType, ServiceCallSite[] serviceCallSites)
			: base(cache)
		{
			ItemType = itemType;
			ServiceCallSites = serviceCallSites;
		}
	}
	internal struct ResultCache
	{
		public static ResultCache None { get; } = new ResultCache(CallSiteResultCacheLocation.None, ServiceCacheKey.Empty);


		public CallSiteResultCacheLocation Location { get; set; }

		public ServiceCacheKey Key { get; set; }

		internal ResultCache(CallSiteResultCacheLocation lifetime, ServiceCacheKey cacheKey)
		{
			Location = lifetime;
			Key = cacheKey;
		}

		public ResultCache(ServiceLifetime lifetime, Type? type, int slot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected I4, but got Unknown
			switch ((int)lifetime)
			{
			case 0:
				Location = CallSiteResultCacheLocation.Root;
				break;
			case 1:
				Location = CallSiteResultCacheLocation.Scope;
				break;
			case 2:
				Location = CallSiteResultCacheLocation.Dispose;
				break;
			default:
				Location = CallSiteResultCacheLocation.None;
				break;
			}
			Key = new ServiceCacheKey(type, slot);
		}
	}
	[RequiresDynamicCode("Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.")]
	internal sealed class RuntimeServiceProviderEngine : ServiceProviderEngine
	{
		public static RuntimeServiceProviderEngine Instance { get; } = new RuntimeServiceProviderEngine();


		private RuntimeServiceProviderEngine()
		{
		}

		public override Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite)
		{
			ServiceCallSite callSite2 = callSite;
			return (ServiceProviderEngineScope scope) => CallSiteRuntimeResolver.Instance.Resolve(callSite2, scope);
		}
	}
	internal readonly struct ServiceCacheKey : IEquatable<ServiceCacheKey>
	{
		public static ServiceCacheKey Empty { get; } = new ServiceCacheKey(null, 0);


		public Type? Type { get; }

		public int Slot { get; }

		public ServiceCacheKey(Type? type, int slot)
		{
			Type = type;
			Slot = slot;
		}

		public bool Equals(ServiceCacheKey other)
		{
			if (Type == other.Type)
			{
				return Slot == other.Slot;
			}
			return false;
		}

		public override bool Equals([NotNullWhen(true)] object? obj)
		{
			if (obj is ServiceCacheKey other)
			{
				return Equals(other);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return ((Type?.GetHashCode() ?? 23) * 397) ^ Slot;
		}
	}
	internal abstract class ServiceCallSite
	{
		public abstract Type ServiceType { get; }

		public abstract Type? ImplementationType { get; }

		public abstract CallSiteKind Kind { get; }

		public ResultCache Cache { get; }

		public object? Value { get; set; }

		public bool CaptureDisposable
		{
			get
			{
				if (!(ImplementationType == null) && !typeof(IDisposable).IsAssignableFrom(ImplementationType))
				{
					return typeof(IAsyncDisposable).IsAssignableFrom(ImplementationType);
				}
				return true;
			}
		}

		protected ServiceCallSite(ResultCache cache)
		{
			Cache = cache;
		}
	}
	internal static class ServiceLookupHelpers
	{
		private const BindingFlags LookupFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;

		private static readonly MethodInfo ArrayEmptyMethodInfo = typeof(Array).GetMethod("Empty");

		internal static readonly MethodInfo InvokeFactoryMethodInfo = typeof(Func<IServiceProvider, object>).GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		internal static readonly MethodInfo CaptureDisposableMethodInfo = typeof(ServiceProviderEngineScope).GetMethod("CaptureDisposable", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		internal static readonly MethodInfo TryGetValueMethodInfo = typeof(IDictionary<ServiceCacheKey, object>).GetMethod("TryGetValue", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		internal static readonly MethodInfo ResolveCallSiteAndScopeMethodInfo = typeof(CallSiteRuntimeResolver).GetMethod("Resolve", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		internal static readonly MethodInfo AddMethodInfo = typeof(IDictionary<ServiceCacheKey, object>).GetMethod("Add", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

		internal static readonly MethodInfo MonitorEnterMethodInfo = typeof(Monitor).GetMethod("Enter", BindingFlags.Static | BindingFlags.Public, null, new Type[2]
		{
			typeof(object),
			typeof(bool).MakeByRefType()
		}, null);

		internal static readonly MethodInfo MonitorExitMethodInfo = typeof(Monitor).GetMethod("Exit", BindingFlags.Static | BindingFlags.Public, null, new Type[1] { typeof(object) }, null);

		[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod", Justification = "Calling Array.Empty<T>() is safe since the T doesn't have trimming annotations.")]
		internal static MethodInfo GetArrayEmptyMethodInfo(Type itemType)
		{
			return ArrayEmptyMethodInfo.MakeGenericMethod(itemType);
		}
	}
	internal sealed class ServiceProviderCallSite : ServiceCallSite
	{
		public override Type ServiceType { get; } = typeof(IServiceProvider);


		public override Type ImplementationType { get; } = typeof(ServiceProvider);


		public override CallSiteKind Kind { get; } = CallSiteKind.ServiceProvider;


		public ServiceProviderCallSite()
			: base(ResultCache.None)
		{
		}
	}
	internal abstract class ServiceProviderEngine
	{
		public abstract Func<ServiceProviderEngineScope, object?> RealizeService(ServiceCallSite callSite);
	}
	internal sealed class ServiceProviderEngineScope : IServiceScope, IDisposable, IServiceProvider, IAsyncDisposable, IServiceScopeFactory
	{
		private bool _disposed;

		private List<object> _disposables;

		internal IList<object> Disposables
		{
			get
			{
				IList<object> disposables = _disposables;
				return disposables ?? Array.Empty<object>();
			}
		}

		internal Dictionary<ServiceCacheKey, object?> ResolvedServices { get; }

		internal object Sync => ResolvedServices;

		public bool IsRootScope { get; }

		internal ServiceProvider RootProvider { get; }

		public IServiceProvider ServiceProvider => this;

		public ServiceProviderEngineScope(ServiceProvider provider, bool isRootScope)
		{
			ResolvedServices = new Dictionary<ServiceCacheKey, object>();
			RootProvider = provider;
			IsRootScope = isRootScope;
		}

		public object? GetService(Type serviceType)
		{
			if (_disposed)
			{
				ThrowHelper.ThrowObjectDisposedException();
			}
			return RootProvider.GetService(serviceType, this);
		}

		public IServiceScope CreateScope()
		{
			return RootProvider.CreateScope();
		}

		[return: NotNullIfNotNull("service")]
		internal object? CaptureDisposable(object? service)
		{
			object service2 = service;
			if (this == service2 || (!(service2 is IDisposable) && !(service2 is IAsyncDisposable)))
			{
				return service2;
			}
			bool flag = false;
			lock (Sync)
			{
				if (_disposed)
				{
					flag = true;
				}
				else
				{
					if (_disposables == null)
					{
						_disposables = new List<object>();
					}
					_disposables.Add(service2);
				}
			}
			if (flag)
			{
				if (service2 is IDisposable disposable)
				{
					disposable.Dispose();
				}
				else
				{
					Task.Run(() => ((IAsyncDisposable)service2).DisposeAsync().AsTask()).GetAwaiter().GetResult();
				}
				ThrowHelper.ThrowObjectDisposedException();
			}
			return service2;
		}

		public void Dispose()
		{
			List<object> list = BeginDispose();
			if (list == null)
			{
				return;
			}
			int num = list.Count - 1;
			while (num >= 0)
			{
				if (list[num] is IDisposable disposable)
				{
					disposable.Dispose();
					num--;
					continue;
				}
				throw new InvalidOperationException(System.SR.Format(System.SR.AsyncDisposableServiceDispose, TypeNameHelper.GetTypeDisplayName(list[num])));
			}
		}

		public ValueTask DisposeAsync()
		{
			List<object> list = BeginDispose();
			if (list != null)
			{
				try
				{
					for (int num = list.Count - 1; num >= 0; num--)
					{
						object obj = list[num];
						if (obj is IAsyncDisposable asyncDisposable)
						{
							ValueTask vt2 = asyncDisposable.DisposeAsync();
							if (!vt2.IsCompletedSuccessfully)
							{
								return Await(num, vt2, list);
							}
							vt2.GetAwaiter().GetResult();
						}
						else
						{
							((IDisposable)obj).Dispose();
						}
					}
				}
				catch (Exception exception)
				{
					return new ValueTask(Task.FromException(exception));
				}
			}
			return default(ValueTask);
			static async ValueTask Await(int i, ValueTask vt, List<object> toDispose)
			{
				await vt.ConfigureAwait(continueOnCapturedContext: false);
				i--;
				while (i >= 0)
				{
					object obj2 = toDispose[i];
					if (obj2 is IAsyncDisposable asyncDisposable2)
					{
						await asyncDisposable2.DisposeAsync().ConfigureAwait(continueOnCapturedContext: false);
					}
					else
					{
						((IDisposable)obj2).Dispose();
					}
					i--;
				}
			}
		}

		private List<object> BeginDispose()
		{
			lock (Sync)
			{
				if (_disposed)
				{
					return null;
				}
				DependencyInjectionEventSource.Log.ScopeDisposed(RootProvider.GetHashCode(), ResolvedServices.Count, _disposables?.Count ?? 0);
				_disposed = true;
			}
			if (IsRootScope && !RootProvider.IsDisposed())
			{
				RootProvider.Dispose();
			}
			return _disposables;
		}
	}
	internal sealed class StackGuard
	{
		private const int MaxExecutionStackCount = 1024;

		private int _executionStackCount;

		public bool TryEnterOnCurrentStack()
		{
			try
			{
				RuntimeHelpers.EnsureSufficientExecutionStack();
				return true;
			}
			catch (InsufficientExecutionStackException)
			{
			}
			if (_executionStackCount < 1024)
			{
				return false;
			}
			throw new InsufficientExecutionStackException();
		}

		public TR RunOnEmptyStack<T1, T2, TR>(Func<T1, T2, TR> action, T1 arg1, T2 arg2)
		{
			return RunOnEmptyStackCore(delegate(object s)
			{
				Tuple<Func<T1, T2, TR>, T1, T2> tuple = (Tuple<Func<T1, T2, TR>, T1, T2>)s;
				return tuple.Item1(tuple.Item2, tuple.Item3);
			}, Tuple.Create(action, arg1, arg2));
		}

		private R RunOnEmptyStackCore<R>(Func<object, R> action, object state)
		{
			_executionStackCount++;
			try
			{
				Task<R> task = Task.Factory.StartNew(action, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
				if (!task.IsCompleted)
				{
					((IAsyncResult)task).AsyncWaitHandle.WaitOne();
				}
				return task.GetAwaiter().GetResult();
			}
			finally
			{
				_executionStackCount--;
			}
		}
	}
	internal static class ThrowHelper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		[DoesNotReturn]
		internal static void ThrowObjectDisposedException()
		{
			throw new ObjectDisposedException("IServiceProvider");
		}
	}
	[RequiresDynamicCode("Creates DynamicMethods")]
	internal sealed class ILEmitResolverBuilder : CallSiteVisitor<ILEmitResolverBuilderContext, object?>
	{
		private sealed class ILEmitResolverBuilderRuntimeContext
		{
			public object[] Constants;

			public Func<IServiceProvider, object>[] Factories;
		}

		private struct GeneratedMethod
		{
			public Func<ServiceProviderEngineScope, object> Lambda;

			public ILEmitResolverBuilderRuntimeContext Context;

			public DynamicMethod DynamicMethod;
		}

		private static readonly MethodInfo ResolvedServicesGetter = typeof(ServiceProviderEngineScope).GetProperty("ResolvedServices", BindingFlags.Instance | BindingFlags.NonPublic).GetMethod;

		private static readonly MethodInfo ScopeLockGetter = typeof(ServiceProviderEngineScope).GetProperty("Sync", BindingFlags.Instance | BindingFlags.NonPublic).GetMethod;

		private static readonly MethodInfo ScopeIsRootScope = typeof(ServiceProviderEngineScope).GetProperty("IsRootScope", BindingFlags.Instance | BindingFlags.Public).GetMethod;

		private static readonly MethodInfo CallSiteRuntimeResolverResolveMethod = typeof(CallSiteRuntimeResolver).GetMethod("Resolve", BindingFlags.Instance | BindingFlags.Public);

		private static readonly MethodInfo CallSiteRuntimeResolverInstanceField = typeof(CallSiteRuntimeResolver).GetProperty("Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public).GetMethod;

		private static readonly FieldInfo FactoriesField = typeof(ILEmitResolverBuilderRuntimeContext).GetField("Factories");

		private static readonly FieldInfo ConstantsField = typeof(ILEmitResolverBuilderRuntimeContext).GetField("Constants");

		private static readonly MethodInfo GetTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle");

		private static readonly ConstructorInfo CacheKeyCtor = typeof(ServiceCacheKey).GetConstructors()[0];

		private readonly ServiceProviderEngineScope _rootScope;

		private readonly ConcurrentDictionary<ServiceCacheKey, GeneratedMethod> _scopeResolverCache;

		private readonly Func<ServiceCacheKey, ServiceCallSite, GeneratedMethod> _buildTypeDelegate;

		public ILEmitResolverBuilder(ServiceProvider serviceProvider)
		{
			_rootScope = serviceProvider.Root;
			_scopeResolverCache = new ConcurrentDictionary<ServiceCacheKey, GeneratedMethod>();
			_buildTypeDelegate = (ServiceCacheKey key, ServiceCallSite cs) => BuildTypeNoCache(cs);
		}

		public Func<ServiceProviderEngineScope, object?> Build(ServiceCallSite callSite)
		{
			return BuildType(callSite).Lambda;
		}

		private GeneratedMethod BuildType(ServiceCallSite callSite)
		{
			if (callSite.Cache.Location == CallSiteResultCacheLocation.Scope)
			{
				return _scopeResolverCache.GetOrAdd(callSite.Cache.Key, (ServiceCacheKey key) => _buildTypeDelegate(key, callSite));
			}
			return BuildTypeNoCache(callSite);
		}

		private GeneratedMethod BuildTypeNoCache(ServiceCallSite callSite)
		{
			DynamicMethod dynamicMethod = new DynamicMethod("ResolveService", MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, typeof(object), new Type[2]
			{
				typeof(ILEmitResolverBuilderRuntimeContext),
				typeof(ServiceProviderEngineScope)
			}, GetType(), skipVisibility: true);
			ILGenerator iLGenerator = dynamicMethod.GetILGenerator(512);
			ILEmitResolverBuilderRuntimeContext iLEmitResolverBuilderRuntimeContext = GenerateMethodBody(callSite, iLGenerator);
			DependencyInjectionEventSource.Log.DynamicMethodBuilt(_rootScope.RootProvider, callSite.ServiceType, iLGenerator.ILOffset);
			GeneratedMethod result = default(GeneratedMethod);
			result.Lambda = (Func<ServiceProviderEngineScope, object>)dynamicMethod.CreateDelegate(typeof(Func<ServiceProviderEngineScope, object>), iLEmitResolverBuilderRuntimeContext);
			result.Context = iLEmitResolverBuilderRuntimeContext;
			result.DynamicMethod = dynamicMethod;
			return result;
		}

		protected override object? VisitDisposeCache(ServiceCallSite transientCallSite, ILEmitResolverBuilderContext argument)
		{
			if (transientCallSite.CaptureDisposable)
			{
				BeginCaptureDisposable(argument);
				VisitCallSiteMain(transientCallSite, argument);
				EndCaptureDisposable(argument);
			}
			else
			{
				VisitCallSiteMain(transientCallSite, argument);
			}
			return null;
		}

		protected override object? VisitConstructor(ConstructorCallSite constructorCallSite, ILEmitResolverBuilderContext argument)
		{
			ServiceCallSite[] parameterCallSites = constructorCallSite.ParameterCallSites;
			foreach (ServiceCallSite serviceCallSite in parameterCallSites)
			{
				VisitCallSite(serviceCallSite, argument);
				if (serviceCallSite.ServiceType.IsValueType)
				{
					argument.Generator.Emit(OpCodes.Unbox_Any, serviceCallSite.ServiceType);
				}
			}
			argument.Generator.Emit(OpCodes.Newobj, constructorCallSite.ConstructorInfo);
			if (constructorCallSite.ImplementationType.IsValueType)
			{
				argument.Generator.Emit(OpCodes.Box, constructorCallSite.ImplementationType);
			}
			return null;
		}

		protected override object? VisitRootCache(ServiceCallSite callSite, ILEmitResolverBuilderContext argument)
		{
			AddConstant(argument, CallSiteRuntimeResolver.Instance.Resolve(callSite, _rootScope));
			return null;
		}

		protected override object? VisitScopeCache(ServiceCallSite scopedCallSite, ILEmitResolverBuilderContext argument)
		{
			GeneratedMethod generatedMethod = BuildType(scopedCallSite);
			AddConstant(argument, generatedMethod.Context);
			argument.Generator.Emit(OpCodes.Ldarg_1);
			argument.Generator.Emit(OpCodes.Call, generatedMethod.DynamicMethod);
			return null;
		}

		protected override object? VisitConstant(ConstantCallSite constantCallSite, ILEmitResolverBuilderContext argument)
		{
			AddConstant(argument, constantCallSite.DefaultValue);
			return null;
		}

		protected override object? VisitServiceProvider(ServiceProviderCallSite serviceProviderCallSite, ILEmitResolverBuilderContext argument)
		{
			argument.Generator.Emit(OpCodes.Ldarg_1);
			return null;
		}

		protected override object? VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ILEmitResolverBuilderContext argument)
		{
			if (enumerableCallSite.ServiceCallSites.Length == 0)
			{
				argument.Generator.Emit(OpCodes.Call, ServiceLookupHelpers.GetArrayEmptyMethodInfo(enumerableCallSite.ItemType));
			}
			else
			{
				argument.Generator.Emit(OpCodes.Ldc_I4, enumerableCallSite.ServiceCallSites.Length);
				argument.Generator.Emit(OpCodes.Newarr, enumerableCallSite.ItemType);
				for (int i = 0; i < enumerableCallSite.ServiceCallSites.Length; i++)
				{
					argument.Generator.Emit(OpCodes.Dup);
					argument.Generator.Emit(OpCodes.Ldc_I4, i);
					ServiceCallSite serviceCallSite = enumerableCallSite.ServiceCallSites[i];
					VisitCal

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.FileProviders.Abstractions.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.FileProviders.Abstractions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Primitives;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.FileProviders.Abstractions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Abstractions of files and directories.\r\n\r\nCommonly Used Types:\r\nMicrosoft.Extensions.FileProviders.IDirectoryContents\r\nMicrosoft.Extensions.FileProviders.IFileInfo\r\nMicrosoft.Extensions.FileProviders.IFileProvider")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.FileProviders.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.FileProviders.Abstractions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string FileNotExists => GetResourceString("FileNotExists");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace Microsoft.Extensions.FileProviders
{
	public interface IDirectoryContents : IEnumerable<IFileInfo>, IEnumerable
	{
		bool Exists { get; }
	}
	public interface IFileInfo
	{
		bool Exists { get; }

		long Length { get; }

		string? PhysicalPath { get; }

		string Name { get; }

		DateTimeOffset LastModified { get; }

		bool IsDirectory { get; }

		Stream CreateReadStream();
	}
	public interface IFileProvider
	{
		IFileInfo GetFileInfo(string subpath);

		IDirectoryContents GetDirectoryContents(string subpath);

		IChangeToken Watch(string filter);
	}
	public class NotFoundDirectoryContents : IDirectoryContents, IEnumerable<IFileInfo>, IEnumerable
	{
		public static NotFoundDirectoryContents Singleton { get; } = new NotFoundDirectoryContents();


		public bool Exists => false;

		public IEnumerator<IFileInfo> GetEnumerator()
		{
			return Enumerable.Empty<IFileInfo>().GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
	public class NotFoundFileInfo : IFileInfo
	{
		public bool Exists => false;

		public bool IsDirectory => false;

		public DateTimeOffset LastModified => DateTimeOffset.MinValue;

		public long Length => -1L;

		public string Name { get; }

		public string? PhysicalPath => null;

		public NotFoundFileInfo(string name)
		{
			Name = name;
		}

		[DoesNotReturn]
		public Stream CreateReadStream()
		{
			throw new FileNotFoundException(System.SR.Format(System.SR.FileNotExists, Name));
		}
	}
	public class NullChangeToken : IChangeToken
	{
		public static NullChangeToken Singleton { get; } = new NullChangeToken();


		public bool HasChanged => false;

		public bool ActiveChangeCallbacks => false;

		private NullChangeToken()
		{
		}

		public IDisposable RegisterChangeCallback(Action<object?> callback, object? state)
		{
			return EmptyDisposable.Instance;
		}
	}
	public class NullFileProvider : IFileProvider
	{
		public IDirectoryContents GetDirectoryContents(string subpath)
		{
			return NotFoundDirectoryContents.Singleton;
		}

		public IFileInfo GetFileInfo(string subpath)
		{
			return new NotFoundFileInfo(subpath);
		}

		public IChangeToken Watch(string filter)
		{
			return (IChangeToken)(object)NullChangeToken.Singleton;
		}
	}
	internal sealed class EmptyDisposable : IDisposable
	{
		public static EmptyDisposable Instance { get; } = new EmptyDisposable();


		private EmptyDisposable()
		{
		}

		public void Dispose()
		{
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.FileProviders.Physical.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.FileProviders.Physical;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.FileProviders.Internal;
using Microsoft.Extensions.FileProviders.Physical;
using Microsoft.Extensions.FileProviders.Physical.Internal;
using Microsoft.Extensions.FileSystemGlobbing;
using Microsoft.Extensions.FileSystemGlobbing.Abstractions;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Primitives;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.FileProviders.Physical.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.FileProviders.Physical")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("File provider for physical files for Microsoft.Extensions.FileProviders.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.FileProviders.Physical")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("7.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.FileProviders.Physical
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string Error_FileSystemWatcherRequiredWithoutPolling => GetResourceString("Error_FileSystemWatcherRequiredWithoutPolling");

		internal static string CannotCreateStream => GetResourceString("CannotCreateStream");

		internal static string CannotModifyWhenFileWatcherInitialized => GetResourceString("CannotModifyWhenFileWatcherInitialized");

		internal static string UnexpectedFileSystemInfo => GetResourceString("UnexpectedFileSystemInfo");

		internal static string FileSystemWatcher_PlatformNotSupported => GetResourceString("FileSystemWatcher_PlatformNotSupported");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.Versioning
{
	internal abstract class OSPlatformAttribute : Attribute
	{
		public string PlatformName { get; }

		private protected OSPlatformAttribute(string platformName)
		{
			PlatformName = platformName;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
	internal sealed class TargetPlatformAttribute : OSPlatformAttribute
	{
		public TargetPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public string? Message { get; }

		public UnsupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public UnsupportedOSPlatformAttribute(string platformName, string? message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class ObsoletedOSPlatformAttribute : OSPlatformAttribute
	{
		public string? Message { get; }

		public string? Url { get; set; }

		public ObsoletedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public ObsoletedOSPlatformAttribute(string platformName, string? message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public UnsupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Internal
{
	internal static class NonCapturingTimer
	{
		public static Timer Create(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
		{
			if (callback == null)
			{
				throw new ArgumentNullException("callback");
			}
			bool flag = false;
			try
			{
				if (!ExecutionContext.IsFlowSuppressed())
				{
					ExecutionContext.SuppressFlow();
					flag = true;
				}
				return new Timer(callback, state, dueTime, period);
			}
			finally
			{
				if (flag)
				{
					ExecutionContext.RestoreFlow();
				}
			}
		}
	}
}
namespace Microsoft.Extensions.FileProviders
{
	internal interface IPollingChangeToken : IChangeToken
	{
		CancellationTokenSource? CancellationTokenSource { get; }
	}
	public class PhysicalFileProvider : IFileProvider, IDisposable
	{
		private const string PollingEnvironmentKey = "DOTNET_USE_POLLING_FILE_WATCHER";

		private static readonly char[] _pathSeparators = new char[2]
		{
			Path.DirectorySeparatorChar,
			Path.AltDirectorySeparatorChar
		};

		private readonly ExclusionFilters _filters;

		private readonly Func<PhysicalFilesWatcher> _fileWatcherFactory;

		private PhysicalFilesWatcher _fileWatcher;

		private bool _fileWatcherInitialized;

		private object _fileWatcherLock = new object();

		private bool? _usePollingFileWatcher;

		private bool? _useActivePolling;

		private bool _disposed;

		public bool UsePollingFileWatcher
		{
			get
			{
				if (_fileWatcher != null)
				{
					return false;
				}
				if (!_usePollingFileWatcher.HasValue)
				{
					ReadPollingEnvironmentVariables();
				}
				return _usePollingFileWatcher.GetValueOrDefault();
			}
			set
			{
				if (_fileWatcher != null)
				{
					throw new InvalidOperationException(System.SR.Format(System.SR.CannotModifyWhenFileWatcherInitialized, "UsePollingFileWatcher"));
				}
				_usePollingFileWatcher = value;
			}
		}

		public bool UseActivePolling
		{
			get
			{
				if (!_useActivePolling.HasValue)
				{
					ReadPollingEnvironmentVariables();
				}
				return _useActivePolling.Value;
			}
			set
			{
				_useActivePolling = value;
			}
		}

		internal PhysicalFilesWatcher FileWatcher
		{
			get
			{
				return LazyInitializer.EnsureInitialized(ref _fileWatcher, ref _fileWatcherInitialized, ref _fileWatcherLock, _fileWatcherFactory);
			}
			set
			{
				_fileWatcherInitialized = true;
				_fileWatcher = value;
			}
		}

		public string Root { get; }

		public PhysicalFileProvider(string root)
			: this(root, ExclusionFilters.Sensitive)
		{
		}

		public PhysicalFileProvider(string root, ExclusionFilters filters)
		{
			if (!Path.IsPathRooted(root))
			{
				throw new ArgumentException("The path must be absolute.", "root");
			}
			string fullPath = Path.GetFullPath(root);
			Root = PathUtils.EnsureTrailingSlash(fullPath);
			if (!Directory.Exists(Root))
			{
				throw new DirectoryNotFoundException(Root);
			}
			_filters = filters;
			_fileWatcherFactory = CreateFileWatcher;
		}

		internal PhysicalFilesWatcher CreateFileWatcher()
		{
			string text = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root));
			FileSystemWatcher fileSystemWatcher = ((UsePollingFileWatcher && UseActivePolling) ? null : new FileSystemWatcher(text));
			return new PhysicalFilesWatcher(text, fileSystemWatcher, UsePollingFileWatcher, _filters)
			{
				UseActivePolling = UseActivePolling
			};
		}

		[MemberNotNull("_usePollingFileWatcher")]
		[MemberNotNull("_useActivePolling")]
		private void ReadPollingEnvironmentVariables()
		{
			string environmentVariable = Environment.GetEnvironmentVariable("DOTNET_USE_POLLING_FILE_WATCHER");
			bool value = string.Equals(environmentVariable, "1", StringComparison.Ordinal) || string.Equals(environmentVariable, "true", StringComparison.OrdinalIgnoreCase);
			_usePollingFileWatcher = value;
			_useActivePolling = value;
		}

		public void Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (!_disposed)
			{
				if (disposing)
				{
					_fileWatcher?.Dispose();
				}
				_disposed = true;
			}
		}

		private string GetFullPath(string path)
		{
			if (PathUtils.PathNavigatesAboveRoot(path))
			{
				return null;
			}
			string fullPath;
			try
			{
				fullPath = Path.GetFullPath(Path.Combine(Root, path));
			}
			catch
			{
				return null;
			}
			if (!IsUnderneathRoot(fullPath))
			{
				return null;
			}
			return fullPath;
		}

		private bool IsUnderneathRoot(string fullPath)
		{
			return fullPath.StartsWith(Root, StringComparison.OrdinalIgnoreCase);
		}

		public IFileInfo GetFileInfo(string subpath)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			if (string.IsNullOrEmpty(subpath) || PathUtils.HasInvalidPathChars(subpath))
			{
				return (IFileInfo)new NotFoundFileInfo(subpath);
			}
			subpath = subpath.TrimStart(_pathSeparators);
			if (Path.IsPathRooted(subpath))
			{
				return (IFileInfo)new NotFoundFileInfo(subpath);
			}
			string fullPath = GetFullPath(subpath);
			if (fullPath == null)
			{
				return (IFileInfo)new NotFoundFileInfo(subpath);
			}
			FileInfo fileInfo = new FileInfo(fullPath);
			if (FileSystemInfoHelper.IsExcluded(fileInfo, _filters))
			{
				return (IFileInfo)new NotFoundFileInfo(subpath);
			}
			return (IFileInfo)(object)new PhysicalFileInfo(fileInfo);
		}

		public IDirectoryContents GetDirectoryContents(string subpath)
		{
			try
			{
				if (subpath == null || PathUtils.HasInvalidPathChars(subpath))
				{
					return (IDirectoryContents)(object)NotFoundDirectoryContents.Singleton;
				}
				subpath = subpath.TrimStart(_pathSeparators);
				if (Path.IsPathRooted(subpath))
				{
					return (IDirectoryContents)(object)NotFoundDirectoryContents.Singleton;
				}
				string fullPath = GetFullPath(subpath);
				if (fullPath == null || !Directory.Exists(fullPath))
				{
					return (IDirectoryContents)(object)NotFoundDirectoryContents.Singleton;
				}
				return (IDirectoryContents)(object)new PhysicalDirectoryContents(fullPath, _filters);
			}
			catch (DirectoryNotFoundException)
			{
			}
			catch (IOException)
			{
			}
			return (IDirectoryContents)(object)NotFoundDirectoryContents.Singleton;
		}

		public IChangeToken Watch(string filter)
		{
			if (filter == null || PathUtils.HasInvalidFilterChars(filter))
			{
				return (IChangeToken)(object)NullChangeToken.Singleton;
			}
			filter = filter.TrimStart(_pathSeparators);
			return FileWatcher.CreateFileChangeToken(filter);
		}
	}
	internal sealed class EmptyDisposable : IDisposable
	{
		public static EmptyDisposable Instance { get; } = new EmptyDisposable();


		private EmptyDisposable()
		{
		}

		public void Dispose()
		{
		}
	}
}
namespace Microsoft.Extensions.FileProviders.Internal
{
	public class PhysicalDirectoryContents : IDirectoryContents, IEnumerable<IFileInfo>, IEnumerable
	{
		private IEnumerable<IFileInfo> _entries;

		private readonly string _directory;

		private readonly ExclusionFilters _filters;

		public bool Exists => Directory.Exists(_directory);

		public PhysicalDirectoryContents(string directory)
			: this(directory, ExclusionFilters.Sensitive)
		{
		}

		public PhysicalDirectoryContents(string directory, ExclusionFilters filters)
		{
			System.ThrowHelper.ThrowIfNull(directory, "directory");
			_directory = directory;
			_filters = filters;
		}

		public IEnumerator<IFileInfo> GetEnumerator()
		{
			EnsureInitialized();
			return _entries.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			EnsureInitialized();
			return _entries.GetEnumerator();
		}

		[MemberNotNull("_entries")]
		private void EnsureInitialized()
		{
			try
			{
				_entries = (from info in new DirectoryInfo(_directory).EnumerateFileSystemInfos()
					where !FileSystemInfoHelper.IsExcluded(info, _filters)
					select info).Select((Func<FileSystemInfo, IFileInfo>)delegate(FileSystemInfo info)
				{
					if (info is FileInfo info2)
					{
						return (IFileInfo)(object)new PhysicalFileInfo(info2);
					}
					if (info is DirectoryInfo info3)
					{
						return (IFileInfo)(object)new PhysicalDirectoryInfo(info3);
					}
					throw new InvalidOperationException(System.SR.UnexpectedFileSystemInfo);
				});
			}
			catch (Exception ex) when (ex is DirectoryNotFoundException || ex is IOException)
			{
				_entries = Enumerable.Empty<IFileInfo>();
			}
		}
	}
}
namespace Microsoft.Extensions.FileProviders.Physical
{
	[Flags]
	public enum ExclusionFilters
	{
		Sensitive = 7,
		DotPrefixed = 1,
		Hidden = 2,
		System = 4,
		None = 0
	}
	internal sealed class Clock : IClock
	{
		public static readonly Clock Instance = new Clock();

		public DateTime UtcNow => DateTime.UtcNow;

		private Clock()
		{
		}
	}
	internal static class FileSystemInfoHelper
	{
		public static bool IsExcluded(FileSystemInfo fileSystemInfo, ExclusionFilters filters)
		{
			if (filters == ExclusionFilters.None)
			{
				return false;
			}
			if (fileSystemInfo.Name.StartsWith(".", StringComparison.Ordinal) && (filters & ExclusionFilters.DotPrefixed) != 0)
			{
				return true;
			}
			if (fileSystemInfo.Exists && (((fileSystemInfo.Attributes & FileAttributes.Hidden) != 0 && (filters & ExclusionFilters.Hidden) != 0) || ((fileSystemInfo.Attributes & FileAttributes.System) != 0 && (filters & ExclusionFilters.System) != 0)))
			{
				return true;
			}
			return false;
		}

		public static DateTime? GetFileLinkTargetLastWriteTimeUtc(string filePath)
		{
			return null;
		}

		public static DateTime? GetFileLinkTargetLastWriteTimeUtc(FileInfo fileInfo)
		{
			return null;
		}
	}
	internal interface IClock
	{
		DateTime UtcNow { get; }
	}
	public class PhysicalDirectoryInfo : IFileInfo
	{
		private readonly DirectoryInfo _info;

		public bool Exists => _info.Exists;

		public long Length => -1L;

		public string PhysicalPath => _info.FullName;

		public string Name => _info.Name;

		public DateTimeOffset LastModified => _info.LastWriteTimeUtc;

		public bool IsDirectory => true;

		public PhysicalDirectoryInfo(DirectoryInfo info)
		{
			_info = info;
		}

		public Stream CreateReadStream()
		{
			throw new InvalidOperationException(System.SR.CannotCreateStream);
		}
	}
	public class PhysicalFileInfo : IFileInfo
	{
		private readonly FileInfo _info;

		public bool Exists => _info.Exists;

		public long Length => _info.Length;

		public string PhysicalPath => _info.FullName;

		public string Name => _info.Name;

		public DateTimeOffset LastModified => _info.LastWriteTimeUtc;

		public bool IsDirectory => false;

		public PhysicalFileInfo(FileInfo info)
		{
			_info = info;
		}

		public Stream CreateReadStream()
		{
			int bufferSize = 1;
			return new FileStream(PhysicalPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize, FileOptions.Asynchronous | FileOptions.SequentialScan);
		}
	}
	public class PhysicalFilesWatcher : IDisposable
	{
		private readonly struct ChangeTokenInfo
		{
			public CancellationTokenSource TokenSource { get; }

			public CancellationChangeToken ChangeToken { get; }

			public Matcher Matcher { get; }

			public ChangeTokenInfo(CancellationTokenSource tokenSource, CancellationChangeToken changeToken)
				: this(tokenSource, changeToken, null)
			{
			}

			public ChangeTokenInfo(CancellationTokenSource tokenSource, CancellationChangeToken changeToken, Matcher matcher)
			{
				TokenSource = tokenSource;
				ChangeToken = changeToken;
				Matcher = matcher;
			}
		}

		private static readonly Action<object> _cancelTokenSource = delegate(object state)
		{
			((CancellationTokenSource)state).Cancel();
		};

		internal static TimeSpan DefaultPollingInterval = TimeSpan.FromSeconds(4.0);

		private readonly ConcurrentDictionary<string, ChangeTokenInfo> _filePathTokenLookup = new ConcurrentDictionary<string, ChangeTokenInfo>(StringComparer.OrdinalIgnoreCase);

		private readonly ConcurrentDictionary<string, ChangeTokenInfo> _wildcardTokenLookup = new ConcurrentDictionary<string, ChangeTokenInfo>(StringComparer.OrdinalIgnoreCase);

		private readonly FileSystemWatcher _fileWatcher;

		private readonly object _fileWatcherLock = new object();

		private readonly string _root;

		private readonly ExclusionFilters _filters;

		private Timer _timer;

		private bool _timerInitialized;

		private object _timerLock = new object();

		private Func<Timer> _timerFactory;

		private bool _disposed;

		internal bool PollForChanges { get; }

		internal bool UseActivePolling { get; set; }

		internal ConcurrentDictionary<IPollingChangeToken, IPollingChangeToken> PollingChangeTokens { get; }

		public PhysicalFilesWatcher(string root, FileSystemWatcher? fileSystemWatcher, bool pollForChanges)
			: this(root, fileSystemWatcher, pollForChanges, ExclusionFilters.Sensitive)
		{
		}

		public PhysicalFilesWatcher(string root, FileSystemWatcher? fileSystemWatcher, bool pollForChanges, ExclusionFilters filters)
		{
			if (fileSystemWatcher == null && !pollForChanges)
			{
				throw new ArgumentNullException("fileSystemWatcher", System.SR.Error_FileSystemWatcherRequiredWithoutPolling);
			}
			_root = root;
			if (fileSystemWatcher != null)
			{
				_fileWatcher = fileSystemWatcher;
				_fileWatcher.IncludeSubdirectories = true;
				_fileWatcher.Created += OnChanged;
				_fileWatcher.Changed += OnChanged;
				_fileWatcher.Renamed += OnRenamed;
				_fileWatcher.Deleted += OnChanged;
				_fileWatcher.Error += OnError;
			}
			PollForChanges = pollForChanges;
			_filters = filters;
			PollingChangeTokens = new ConcurrentDictionary<IPollingChangeToken, IPollingChangeToken>();
			_timerFactory = () => NonCapturingTimer.Create(RaiseChangeEvents, PollingChangeTokens, TimeSpan.Zero, DefaultPollingInterval);
		}

		public IChangeToken CreateFileChangeToken(string filter)
		{
			System.ThrowHelper.ThrowIfNull(filter, "filter");
			filter = NormalizePath(filter);
			if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter))
			{
				return (IChangeToken)(object)NullChangeToken.Singleton;
			}
			IChangeToken orAddChangeToken = GetOrAddChangeToken(filter);
			TryEnableFileSystemWatcher();
			return orAddChangeToken;
		}

		private IChangeToken GetOrAddChangeToken(string pattern)
		{
			if (UseActivePolling)
			{
				LazyInitializer.EnsureInitialized(ref _timer, ref _timerInitialized, ref _timerLock, _timerFactory);
			}
			if (pattern.IndexOf('*') != -1 || IsDirectoryPath(pattern))
			{
				return GetOrAddWildcardChangeToken(pattern);
			}
			return GetOrAddFilePathChangeToken(pattern);
		}

		internal IChangeToken GetOrAddFilePathChangeToken(string filePath)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			if (!_filePathTokenLookup.TryGetValue(filePath, out var value))
			{
				CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
				CancellationChangeToken changeToken = new CancellationChangeToken(cancellationTokenSource.Token);
				value = new ChangeTokenInfo(cancellationTokenSource, changeToken);
				value = _filePathTokenLookup.GetOrAdd(filePath, value);
			}
			IChangeToken val = (IChangeToken)(object)value.ChangeToken;
			if (PollForChanges)
			{
				PollingFileChangeToken pollingFileChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath)));
				if (UseActivePolling)
				{
					pollingFileChangeToken.ActiveChangeCallbacks = true;
					pollingFileChangeToken.CancellationTokenSource = new CancellationTokenSource();
					PollingChangeTokens.TryAdd(pollingFileChangeToken, pollingFileChangeToken);
				}
				val = (IChangeToken)new CompositeChangeToken((IReadOnlyList<IChangeToken>)(object)new IChangeToken[2] { val, pollingFileChangeToken });
			}
			return val;
		}

		internal IChangeToken GetOrAddWildcardChangeToken(string pattern)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			if (!_wildcardTokenLookup.TryGetValue(pattern, out var value))
			{
				CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
				CancellationChangeToken changeToken = new CancellationChangeToken(cancellationTokenSource.Token);
				Matcher val = new Matcher(StringComparison.OrdinalIgnoreCase);
				val.AddInclude(pattern);
				value = new ChangeTokenInfo(cancellationTokenSource, changeToken, val);
				value = _wildcardTokenLookup.GetOrAdd(pattern, value);
			}
			IChangeToken val2 = (IChangeToken)(object)value.ChangeToken;
			if (PollForChanges)
			{
				PollingWildCardChangeToken pollingWildCardChangeToken = new PollingWildCardChangeToken(_root, pattern);
				if (UseActivePolling)
				{
					pollingWildCardChangeToken.ActiveChangeCallbacks = true;
					pollingWildCardChangeToken.CancellationTokenSource = new CancellationTokenSource();
					PollingChangeTokens.TryAdd(pollingWildCardChangeToken, pollingWildCardChangeToken);
				}
				val2 = (IChangeToken)new CompositeChangeToken((IReadOnlyList<IChangeToken>)(object)new IChangeToken[2] { val2, pollingWildCardChangeToken });
			}
			return val2;
		}

		public void Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (!_disposed)
			{
				if (disposing)
				{
					_fileWatcher?.Dispose();
					_timer?.Dispose();
				}
				_disposed = true;
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void OnRenamed(object sender, RenamedEventArgs e)
		{
			OnFileSystemEntryChange(e.OldFullPath);
			OnFileSystemEntryChange(e.FullPath);
			if (!Directory.Exists(e.FullPath))
			{
				return;
			}
			try
			{
				foreach (string item in Directory.EnumerateFileSystemEntries(e.FullPath, "*", SearchOption.AllDirectories))
				{
					string fullPath = Path.Combine(e.OldFullPath, item.Substring(e.FullPath.Length + 1));
					OnFileSystemEntryChange(fullPath);
					OnFileSystemEntryChange(item);
				}
			}
			catch (Exception ex) when (ex is IOException || ex is SecurityException || ex is DirectoryNotFoundException || ex is UnauthorizedAccessException)
			{
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void OnChanged(object sender, FileSystemEventArgs e)
		{
			OnFileSystemEntryChange(e.FullPath);
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void OnError(object sender, ErrorEventArgs e)
		{
			foreach (string key in _filePathTokenLookup.Keys)
			{
				ReportChangeForMatchedEntries(key);
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void OnFileSystemEntryChange(string fullPath)
		{
			try
			{
				FileInfo fileSystemInfo = new FileInfo(fullPath);
				if (!FileSystemInfoHelper.IsExcluded(fileSystemInfo, _filters))
				{
					string path = fullPath.Substring(_root.Length);
					ReportChangeForMatchedEntries(path);
				}
			}
			catch (Exception ex) when (ex is IOException || ex is SecurityException || ex is UnauthorizedAccessException)
			{
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void ReportChangeForMatchedEntries(string path)
		{
			if (string.IsNullOrEmpty(path))
			{
				return;
			}
			path = NormalizePath(path);
			bool flag = false;
			if (_filePathTokenLookup.TryRemove(path, out var value))
			{
				CancelToken(value);
				flag = true;
			}
			foreach (KeyValuePair<string, ChangeTokenInfo> item in _wildcardTokenLookup)
			{
				PatternMatchingResult val = MatcherExtensions.Match(item.Value.Matcher, path);
				if (val.HasMatches && _wildcardTokenLookup.TryRemove(item.Key, out value))
				{
					CancelToken(value);
					flag = true;
				}
			}
			if (flag)
			{
				TryDisableFileSystemWatcher();
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void TryDisableFileSystemWatcher()
		{
			if (_fileWatcher == null)
			{
				return;
			}
			lock (_fileWatcherLock)
			{
				if (_filePathTokenLookup.IsEmpty && _wildcardTokenLookup.IsEmpty && _fileWatcher.EnableRaisingEvents)
				{
					_fileWatcher.EnableRaisingEvents = false;
				}
			}
		}

		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		[SupportedOSPlatform("maccatalyst")]
		private void TryEnableFileSystemWatcher()
		{
			if (_fileWatcher == null)
			{
				return;
			}
			lock (_fileWatcherLock)
			{
				if ((!_filePathTokenLookup.IsEmpty || !_wildcardTokenLookup.IsEmpty) && !_fileWatcher.EnableRaisingEvents)
				{
					_fileWatcher.EnableRaisingEvents = true;
				}
			}
		}

		private static string NormalizePath(string filter)
		{
			return filter.Replace('\\', '/');
		}

		private static bool IsDirectoryPath(string path)
		{
			if (path.Length > 0)
			{
				if (path[path.Length - 1] != Path.DirectorySeparatorChar)
				{
					return path[path.Length - 1] == Path.AltDirectorySeparatorChar;
				}
				return true;
			}
			return false;
		}

		private static void CancelToken(ChangeTokenInfo matchInfo)
		{
			if (!matchInfo.TokenSource.IsCancellationRequested)
			{
				Task.Factory.StartNew(_cancelTokenSource, matchInfo.TokenSource, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
			}
		}

		internal static void RaiseChangeEvents(object? state)
		{
			ConcurrentDictionary<IPollingChangeToken, IPollingChangeToken> concurrentDictionary = (ConcurrentDictionary<IPollingChangeToken, IPollingChangeToken>)state;
			foreach (KeyValuePair<IPollingChangeToken, IPollingChangeToken> item in concurrentDictionary)
			{
				IPollingChangeToken key = item.Key;
				if (((IChangeToken)key).HasChanged && concurrentDictionary.TryRemove(key, out var _))
				{
					try
					{
						key.CancellationTokenSource.Cancel();
					}
					catch
					{
					}
				}
			}
		}
	}
	public class PollingFileChangeToken : IPollingChangeToken, IChangeToken
	{
		private readonly FileInfo _fileInfo;

		private DateTime _previousWriteTimeUtc;

		private DateTime _lastCheckedTimeUtc;

		private bool _hasChanged;

		private CancellationTokenSource _tokenSource;

		private CancellationChangeToken _changeToken;

		internal static TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;


		public bool ActiveChangeCallbacks { get; internal set; }

		internal CancellationTokenSource? CancellationTokenSource
		{
			get
			{
				return _tokenSource;
			}
			[param: DisallowNull]
			set
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Expected O, but got Unknown
				_tokenSource = value;
				_changeToken = new CancellationChangeToken(_tokenSource.Token);
			}
		}

		CancellationTokenSource? IPollingChangeToken.CancellationTokenSource => CancellationTokenSource;

		public bool HasChanged
		{
			get
			{
				if (_hasChanged)
				{
					return _hasChanged;
				}
				DateTime utcNow = DateTime.UtcNow;
				if (utcNow - _lastCheckedTimeUtc < PollingInterval)
				{
					return _hasChanged;
				}
				DateTime lastWriteTimeUtc = GetLastWriteTimeUtc();
				if (_previousWriteTimeUtc != lastWriteTimeUtc)
				{
					_previousWriteTimeUtc = lastWriteTimeUtc;
					_hasChanged = true;
				}
				_lastCheckedTimeUtc = utcNow;
				return _hasChanged;
			}
		}

		public PollingFileChangeToken(FileInfo fileInfo)
		{
			_fileInfo = fileInfo;
			_previousWriteTimeUtc = GetLastWriteTimeUtc();
		}

		private DateTime GetLastWriteTimeUtc()
		{
			_fileInfo.Refresh();
			if (!_fileInfo.Exists)
			{
				return DateTime.MinValue;
			}
			return FileSystemInfoHelper.GetFileLinkTargetLastWriteTimeUtc(_fileInfo) ?? _fileInfo.LastWriteTimeUtc;
		}

		public IDisposable RegisterChangeCallback(Action<object?> callback, object? state)
		{
			if (!ActiveChangeCallbacks)
			{
				return EmptyDisposable.Instance;
			}
			return _changeToken.RegisterChangeCallback(callback, state);
		}
	}
	public class PollingWildCardChangeToken : IPollingChangeToken, IChangeToken
	{
		private static readonly byte[] Separator = Encoding.Unicode.GetBytes("|");

		private readonly object _enumerationLock = new object();

		private readonly DirectoryInfoBase _directoryInfo;

		private readonly Matcher _matcher;

		private bool _changed;

		private DateTime? _lastScanTimeUtc;

		private byte[] _byteBuffer;

		private byte[] _previousHash;

		private CancellationTokenSource _tokenSource;

		private CancellationChangeToken _changeToken;

		public bool ActiveChangeCallbacks { get; internal set; }

		internal TimeSpan PollingInterval { get; set; } = PhysicalFilesWatcher.DefaultPollingInterval;


		internal CancellationTokenSource? CancellationTokenSource
		{
			get
			{
				return _tokenSource;
			}
			[param: DisallowNull]
			set
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Expected O, but got Unknown
				_tokenSource = value;
				_changeToken = new CancellationChangeToken(_tokenSource.Token);
			}
		}

		CancellationTokenSource? IPollingChangeToken.CancellationTokenSource => CancellationTokenSource;

		private IClock Clock { get; }

		public bool HasChanged
		{
			get
			{
				if (_changed)
				{
					return _changed;
				}
				DateTime utcNow = Clock.UtcNow;
				DateTime? lastScanTimeUtc = _lastScanTimeUtc;
				if (utcNow - lastScanTimeUtc >= PollingInterval)
				{
					lock (_enumerationLock)
					{
						_changed = CalculateChanges();
					}
				}
				return _changed;
			}
		}

		public PollingWildCardChangeToken(string root, string pattern)
			: this((DirectoryInfoBase)new DirectoryInfoWrapper(new DirectoryInfo(root)), pattern, Microsoft.Extensions.FileProviders.Physical.Clock.Instance)
		{
		}//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown


		internal PollingWildCardChangeToken(DirectoryInfoBase directoryInfo, string pattern, IClock clock)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			_directoryInfo = directoryInfo;
			Clock = clock;
			_matcher = new Matcher(StringComparison.OrdinalIgnoreCase);
			_matcher.AddInclude(pattern);
			CalculateChanges();
		}

		private bool CalculateChanges()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			PatternMatchingResult val = _matcher.Execute(_directoryInfo);
			IOrderedEnumerable<FilePatternMatch> orderedEnumerable = val.Files.OrderBy<FilePatternMatch, string>((FilePatternMatch f) => ((FilePatternMatch)(ref f)).Path, StringComparer.Ordinal);
			using (IncrementalHash incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA256))
			{
				foreach (FilePatternMatch item in orderedEnumerable)
				{
					FilePatternMatch current = item;
					DateTime lastWriteUtc = GetLastWriteUtc(((FilePatternMatch)(ref current)).Path);
					if (_lastScanTimeUtc.HasValue && _lastScanTimeUtc < lastWriteUtc)
					{
						return true;
					}
					ComputeHash(incrementalHash, ((FilePatternMatch)(ref current)).Path, lastWriteUtc);
				}
				byte[] hashAndReset = incrementalHash.GetHashAndReset();
				if (!ArrayEquals(_previousHash, hashAndReset))
				{
					return true;
				}
				_previousHash = hashAndReset;
				_lastScanTimeUtc = Clock.UtcNow;
			}
			return false;
		}

		protected virtual DateTime GetLastWriteUtc(string path)
		{
			string text = Path.Combine(((FileSystemInfoBase)_directoryInfo).FullName, path);
			return FileSystemInfoHelper.GetFileLinkTargetLastWriteTimeUtc(text) ?? File.GetLastWriteTimeUtc(text);
		}

		private static bool ArrayEquals(byte[] previousHash, byte[] currentHash)
		{
			return previousHash?.AsSpan().SequenceEqual(currentHash.AsSpan()) ?? true;
		}

		private unsafe void ComputeHash(IncrementalHash sha256, string path, DateTime lastChangedUtc)
		{
			int byteCount = Encoding.Unicode.GetByteCount(path);
			if (_byteBuffer == null || byteCount > _byteBuffer.Length)
			{
				_byteBuffer = new byte[Math.Max(byteCount, 256)];
			}
			int bytes = Encoding.Unicode.GetBytes(path, 0, path.Length, _byteBuffer, 0);
			sha256.AppendData(_byteBuffer, 0, bytes);
			sha256.AppendData(Separator, 0, Separator.Length);
			fixed (byte* ptr = _byteBuffer)
			{
				*(long*)ptr = lastChangedUtc.Ticks;
			}
			sha256.AppendData(_byteBuffer, 0, 8);
			sha256.AppendData(Separator, 0, Separator.Length);
		}

		IDisposable IChangeToken.RegisterChangeCallback(Action<object> callback, object state)
		{
			if (!ActiveChangeCallbacks)
			{
				return EmptyDisposable.Instance;
			}
			return _changeToken.RegisterChangeCallback(callback, state);
		}
	}
}
namespace Microsoft.Extensions.FileProviders.Physical.Internal
{
	internal static class PathUtils
	{
		private static readonly char[] _invalidFileNameChars = (from c in Path.GetInvalidFileNameChars()
			where c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar
			select c).ToArray();

		private static readonly char[] _invalidFilterChars = _invalidFileNameChars.Where((char c) => c != '*' && c != '|' && c != '?').ToArray();

		private static readonly char[] _pathSeparators = new char[2]
		{
			Path.DirectorySeparatorChar,
			Path.AltDirectorySeparatorChar
		};

		internal static bool HasInvalidPathChars(string path)
		{
			return path.IndexOfAny(_invalidFileNameChars) != -1;
		}

		internal static bool HasInvalidFilterChars(string path)
		{
			return path.IndexOfAny(_invalidFilterChars) != -1;
		}

		internal static string EnsureTrailingSlash(string path)
		{
			if (!string.IsNullOrEmpty(path) && path[path.Length - 1] != Path.DirectorySeparatorChar)
			{
				char directorySeparatorChar = Path.DirectorySeparatorChar;
				return path + directorySeparatorChar;
			}
			return path;
		}

		internal static bool PathNavigatesAboveRoot(string path)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			StringTokenizer val = default(StringTokenizer);
			((StringTokenizer)(ref val))..ctor(path, _pathSeparators);
			int num = 0;
			Enumerator enumerator = ((StringTokenizer)(ref val)).GetEnumerator();
			try
			{
				while (((Enumerator)(ref enumerator)).MoveNext())
				{
					StringSegment current = ((Enumerator)(ref enumerator)).Current;
					if (((StringSegment)(ref current)).Equals(".") || ((StringSegment)(ref current)).Equals(""))
					{
						continue;
					}
					if (((StringSegment)(ref current)).Equals(".."))
					{
						num--;
						if (num == -1)
						{
							return true;
						}
					}
					else
					{
						num++;
					}
				}
			}
			finally
			{
				((IDisposable)(Enumerator)(ref enumerator)).Dispose();
			}
			return false;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.FileSystemGlobbing.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Numerics.Hashing;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.FileSystemGlobbing;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.FileSystemGlobbing.Abstractions;
using Microsoft.Extensions.FileSystemGlobbing.Internal;
using Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments;
using Microsoft.Extensions.FileSystemGlobbing.Internal.PatternContexts;
using Microsoft.Extensions.FileSystemGlobbing.Internal.Patterns;
using Microsoft.Extensions.FileSystemGlobbing.Util;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.FileSystemGlobbing.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.FileSystemGlobbing")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("File system globbing to find files matching a specified pattern.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.FileSystemGlobbing")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.FileSystemGlobbing
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string CannotDeclarePathSegment => GetResourceString("CannotDeclarePathSegment");

		internal static string CannotTestDirectory => GetResourceString("CannotTestDirectory");

		internal static string CannotTestFile => GetResourceString("CannotTestFile");

		internal static string StringComparisonTypeShouldBeOrdinal => GetResourceString("StringComparisonTypeShouldBeOrdinal");

		internal static string UnexpectedStringComparisonType => GetResourceString("UnexpectedStringComparisonType");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace System.Numerics.Hashing
{
	internal static class HashHelpers
	{
		public static int Combine(int h1, int h2)
		{
			uint num = (uint)(h1 << 5) | ((uint)h1 >> 27);
			return ((int)num + h1) ^ h2;
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing
{
	public struct FilePatternMatch : IEquatable<FilePatternMatch>
	{
		public string Path { get; }

		public string? Stem { get; }

		public FilePatternMatch(string path, string? stem)
		{
			System.ThrowHelper.ThrowIfNull(path, "path");
			Path = path;
			Stem = stem;
		}

		public bool Equals(FilePatternMatch other)
		{
			if (string.Equals(other.Path, Path, StringComparison.OrdinalIgnoreCase))
			{
				return string.Equals(other.Stem, Stem, StringComparison.OrdinalIgnoreCase);
			}
			return false;
		}

		public override bool Equals([NotNullWhen(true)] object? obj)
		{
			if (obj is FilePatternMatch other)
			{
				return Equals(other);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return HashHelpers.Combine(GetHashCode(Path), GetHashCode(Stem));
		}

		private static int GetHashCode(string value)
		{
			if (value == null)
			{
				return 0;
			}
			return StringComparer.OrdinalIgnoreCase.GetHashCode(value);
		}
	}
	public class InMemoryDirectoryInfo : DirectoryInfoBase
	{
		private static readonly char[] DirectorySeparators = new char[2]
		{
			Path.DirectorySeparatorChar,
			Path.AltDirectorySeparatorChar
		};

		private readonly IEnumerable<string> _files;

		public override string FullName { get; }

		public override string Name { get; }

		public override DirectoryInfoBase? ParentDirectory => new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName), _files, normalized: true);

		public InMemoryDirectoryInfo(string rootDir, IEnumerable<string>? files)
			: this(rootDir, files, normalized: false)
		{
		}

		private InMemoryDirectoryInfo(string rootDir, IEnumerable<string> files, bool normalized)
		{
			if (string.IsNullOrEmpty(rootDir))
			{
				throw new ArgumentNullException("rootDir");
			}
			if (files == null)
			{
				files = new List<string>();
			}
			Name = Path.GetFileName(rootDir);
			if (normalized)
			{
				_files = files;
				FullName = rootDir;
				return;
			}
			List<string> list = new List<string>(files.Count());
			foreach (string file in files)
			{
				list.Add(Path.GetFullPath(file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)));
			}
			_files = list;
			FullName = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
		}

		public override IEnumerable<FileSystemInfoBase> EnumerateFileSystemInfos()
		{
			Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>();
			foreach (string file in _files)
			{
				if (!IsRootDirectory(FullName, file))
				{
					continue;
				}
				int length = file.Length;
				int num = FullName.Length + 1;
				int num2 = file.IndexOfAny(DirectorySeparators, num, length - num);
				if (num2 == -1)
				{
					yield return new InMemoryFileInfo(file, this);
					continue;
				}
				string key = file.Substring(0, num2);
				if (!dict.TryGetValue(key, out var value))
				{
					dict[key] = new List<string> { file };
				}
				else
				{
					value.Add(file);
				}
			}
			foreach (KeyValuePair<string, List<string>> item in dict)
			{
				yield return new InMemoryDirectoryInfo(item.Key, item.Value, normalized: true);
			}
		}

		private static bool IsRootDirectory(string rootDir, string filePath)
		{
			int length = rootDir.Length;
			if (filePath.StartsWith(rootDir, StringComparison.Ordinal))
			{
				if (rootDir[length - 1] != Path.DirectorySeparatorChar)
				{
					return filePath.IndexOf(Path.DirectorySeparatorChar, length) == length;
				}
				return true;
			}
			return false;
		}

		public override DirectoryInfoBase GetDirectory(string path)
		{
			if (string.Equals(path, "..", StringComparison.Ordinal))
			{
				return new InMemoryDirectoryInfo(Path.Combine(FullName, path), _files, normalized: true);
			}
			string fullPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
			return new InMemoryDirectoryInfo(fullPath, _files, normalized: true);
		}

		public override FileInfoBase? GetFile(string path)
		{
			string fullPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
			foreach (string file in _files)
			{
				if (string.Equals(file, fullPath))
				{
					return new InMemoryFileInfo(file, this);
				}
			}
			return null;
		}
	}
	public class Matcher
	{
		private readonly IList<IPattern> _includePatterns = new List<IPattern>();

		private readonly IList<IPattern> _excludePatterns = new List<IPattern>();

		private readonly PatternBuilder _builder;

		private readonly StringComparison _comparison;

		public Matcher()
			: this(StringComparison.OrdinalIgnoreCase)
		{
		}

		public Matcher(StringComparison comparisonType)
		{
			_comparison = comparisonType;
			_builder = new PatternBuilder(comparisonType);
		}

		public virtual Matcher AddInclude(string pattern)
		{
			_includePatterns.Add(_builder.Build(pattern));
			return this;
		}

		public virtual Matcher AddExclude(string pattern)
		{
			_excludePatterns.Add(_builder.Build(pattern));
			return this;
		}

		public virtual PatternMatchingResult Execute(DirectoryInfoBase directoryInfo)
		{
			System.ThrowHelper.ThrowIfNull(directoryInfo, "directoryInfo");
			MatcherContext matcherContext = new MatcherContext(_includePatterns, _excludePatterns, directoryInfo, _comparison);
			return matcherContext.Execute();
		}
	}
	public static class MatcherExtensions
	{
		public static void AddExcludePatterns(this Matcher matcher, params IEnumerable<string>[] excludePatternsGroups)
		{
			foreach (IEnumerable<string> enumerable in excludePatternsGroups)
			{
				foreach (string item in enumerable)
				{
					matcher.AddExclude(item);
				}
			}
		}

		public static void AddIncludePatterns(this Matcher matcher, params IEnumerable<string>[] includePatternsGroups)
		{
			foreach (IEnumerable<string> enumerable in includePatternsGroups)
			{
				foreach (string item in enumerable)
				{
					matcher.AddInclude(item);
				}
			}
		}

		public static IEnumerable<string> GetResultsInFullPath(this Matcher matcher, string directoryPath)
		{
			string directoryPath2 = directoryPath;
			IEnumerable<FilePatternMatch> files = matcher.Execute(new DirectoryInfoWrapper(new DirectoryInfo(directoryPath2))).Files;
			return files.Select((FilePatternMatch match) => Path.GetFullPath(Path.Combine(directoryPath2, match.Path))).ToArray();
		}

		public static PatternMatchingResult Match(this Matcher matcher, string file)
		{
			return matcher.Match(Directory.GetCurrentDirectory(), new List<string> { file });
		}

		public static PatternMatchingResult Match(this Matcher matcher, string rootDir, string file)
		{
			return matcher.Match(rootDir, new List<string> { file });
		}

		public static PatternMatchingResult Match(this Matcher matcher, IEnumerable<string>? files)
		{
			return matcher.Match(Directory.GetCurrentDirectory(), files);
		}

		public static PatternMatchingResult Match(this Matcher matcher, string rootDir, IEnumerable<string>? files)
		{
			System.ThrowHelper.ThrowIfNull(matcher, "matcher");
			return matcher.Execute(new InMemoryDirectoryInfo(rootDir, files));
		}
	}
	public class PatternMatchingResult
	{
		public IEnumerable<FilePatternMatch> Files { get; set; }

		public bool HasMatches { get; }

		public PatternMatchingResult(IEnumerable<FilePatternMatch> files)
			: this(files, files.Any())
		{
			Files = files;
		}

		public PatternMatchingResult(IEnumerable<FilePatternMatch> files, bool hasMatches)
		{
			System.ThrowHelper.ThrowIfNull(files, "files");
			Files = files;
			HasMatches = hasMatches;
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Util
{
	internal static class StringComparisonHelper
	{
		public static StringComparer GetStringComparer(StringComparison comparisonType)
		{
			return comparisonType switch
			{
				StringComparison.CurrentCulture => StringComparer.CurrentCulture, 
				StringComparison.CurrentCultureIgnoreCase => StringComparer.CurrentCultureIgnoreCase, 
				StringComparison.Ordinal => StringComparer.Ordinal, 
				StringComparison.OrdinalIgnoreCase => StringComparer.OrdinalIgnoreCase, 
				StringComparison.InvariantCulture => StringComparer.InvariantCulture, 
				StringComparison.InvariantCultureIgnoreCase => StringComparer.InvariantCultureIgnoreCase, 
				_ => throw new InvalidOperationException(System.SR.Format(System.SR.UnexpectedStringComparisonType, comparisonType)), 
			};
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Internal
{
	public interface ILinearPattern : IPattern
	{
		IList<IPathSegment> Segments { get; }
	}
	internal sealed class InMemoryFileInfo : FileInfoBase
	{
		private InMemoryDirectoryInfo _parent;

		public override string FullName { get; }

		public override string Name { get; }

		public override DirectoryInfoBase ParentDirectory => _parent;

		public InMemoryFileInfo(string file, InMemoryDirectoryInfo parent)
		{
			FullName = file;
			Name = Path.GetFileName(file);
			_parent = parent;
		}
	}
	public interface IPathSegment
	{
		bool CanProduceStem { get; }

		bool Match(string value);
	}
	public interface IPattern
	{
		IPatternContext CreatePatternContextForInclude();

		IPatternContext CreatePatternContextForExclude();
	}
	public interface IPatternContext
	{
		void Declare(Action<IPathSegment, bool> onDeclare);

		bool Test(DirectoryInfoBase directory);

		PatternTestResult Test(FileInfoBase file);

		void PushDirectory(DirectoryInfoBase directory);

		void PopDirectory();
	}
	public interface IRaggedPattern : IPattern
	{
		IList<IPathSegment> Segments { get; }

		IList<IPathSegment> StartsWith { get; }

		IList<IList<IPathSegment>> Contains { get; }

		IList<IPathSegment> EndsWith { get; }
	}
	public class MatcherContext
	{
		private readonly DirectoryInfoBase _root;

		private readonly List<IPatternContext> _includePatternContexts;

		private readonly List<IPatternContext> _excludePatternContexts;

		private readonly List<FilePatternMatch> _files;

		private readonly HashSet<string> _declaredLiteralFolderSegmentInString;

		private readonly HashSet<LiteralPathSegment> _declaredLiteralFileSegments = new HashSet<LiteralPathSegment>();

		private bool _declaredParentPathSegment;

		private bool _declaredWildcardPathSegment;

		private readonly StringComparison _comparisonType;

		public MatcherContext(IEnumerable<IPattern> includePatterns, IEnumerable<IPattern> excludePatterns, DirectoryInfoBase directoryInfo, StringComparison comparison)
		{
			_root = directoryInfo;
			_files = new List<FilePatternMatch>();
			_comparisonType = comparison;
			_includePatternContexts = includePatterns.Select((IPattern pattern) => pattern.CreatePatternContextForInclude()).ToList();
			_excludePatternContexts = excludePatterns.Select((IPattern pattern) => pattern.CreatePatternContextForExclude()).ToList();
			_declaredLiteralFolderSegmentInString = new HashSet<string>(StringComparisonHelper.GetStringComparer(comparison));
		}

		public PatternMatchingResult Execute()
		{
			_files.Clear();
			Match(_root, null);
			return new PatternMatchingResult(_files, _files.Count > 0);
		}

		private void Match(DirectoryInfoBase directory, string parentRelativePath)
		{
			PushDirectory(directory);
			Declare();
			List<FileSystemInfoBase> list = new List<FileSystemInfoBase>();
			if (_declaredWildcardPathSegment || _declaredLiteralFileSegments.Any())
			{
				list.AddRange(directory.EnumerateFileSystemInfos());
			}
			else
			{
				IEnumerable<DirectoryInfoBase> enumerable = directory.EnumerateFileSystemInfos().OfType<DirectoryInfoBase>();
				foreach (DirectoryInfoBase item in enumerable)
				{
					if (_declaredLiteralFolderSegmentInString.Contains(item.Name))
					{
						list.Add(item);
					}
				}
			}
			if (_declaredParentPathSegment)
			{
				list.Add(directory.GetDirectory(".."));
			}
			List<DirectoryInfoBase> list2 = new List<DirectoryInfoBase>();
			foreach (FileSystemInfoBase item2 in list)
			{
				if (item2 is FileInfoBase fileInfoBase)
				{
					PatternTestResult patternTestResult = MatchPatternContexts(fileInfoBase, (IPatternContext pattern, FileInfoBase file) => pattern.Test(file));
					if (patternTestResult.IsSuccessful)
					{
						_files.Add(new FilePatternMatch(CombinePath(parentRelativePath, fileInfoBase.Name), patternTestResult.Stem));
					}
				}
				else if (item2 is DirectoryInfoBase directoryInfoBase && MatchPatternContexts(directoryInfoBase, (IPatternContext pattern, DirectoryInfoBase dir) => pattern.Test(dir)))
				{
					list2.Add(directoryInfoBase);
				}
			}
			foreach (DirectoryInfoBase item3 in list2)
			{
				string parentRelativePath2 = CombinePath(parentRelativePath, item3.Name);
				Match(item3, parentRelativePath2);
			}
			PopDirectory();
		}

		private void Declare()
		{
			_declaredLiteralFileSegments.Clear();
			_declaredParentPathSegment = false;
			_declaredWildcardPathSegment = false;
			foreach (IPatternContext includePatternContext in _includePatternContexts)
			{
				includePatternContext.Declare(DeclareInclude);
			}
		}

		private void DeclareInclude(IPathSegment patternSegment, bool isLastSegment)
		{
			if (patternSegment is LiteralPathSegment literalPathSegment)
			{
				if (isLastSegment)
				{
					_declaredLiteralFileSegments.Add(literalPathSegment);
				}
				else
				{
					_declaredLiteralFolderSegmentInString.Add(literalPathSegment.Value);
				}
			}
			else if (patternSegment is ParentPathSegment)
			{
				_declaredParentPathSegment = true;
			}
			else if (patternSegment is WildcardPathSegment)
			{
				_declaredWildcardPathSegment = true;
			}
		}

		internal static string CombinePath(string? left, string right)
		{
			if (string.IsNullOrEmpty(left))
			{
				return right;
			}
			return left + "/" + right;
		}

		private bool MatchPatternContexts<TFileInfoBase>(TFileInfoBase fileinfo, Func<IPatternContext, TFileInfoBase, bool> test)
		{
			return MatchPatternContexts(fileinfo, (IPatternContext ctx, TFileInfoBase file) => test(ctx, file) ? PatternTestResult.Success(string.Empty) : PatternTestResult.Failed).IsSuccessful;
		}

		private PatternTestResult MatchPatternContexts<TFileInfoBase>(TFileInfoBase fileinfo, Func<IPatternContext, TFileInfoBase, PatternTestResult> test)
		{
			PatternTestResult result = PatternTestResult.Failed;
			foreach (IPatternContext includePatternContext in _includePatternContexts)
			{
				PatternTestResult patternTestResult = test(includePatternContext, fileinfo);
				if (patternTestResult.IsSuccessful)
				{
					result = patternTestResult;
					break;
				}
			}
			if (!result.IsSuccessful)
			{
				return PatternTestResult.Failed;
			}
			foreach (IPatternContext excludePatternContext in _excludePatternContexts)
			{
				if (test(excludePatternContext, fileinfo).IsSuccessful)
				{
					return PatternTestResult.Failed;
				}
			}
			return result;
		}

		private void PopDirectory()
		{
			foreach (IPatternContext excludePatternContext in _excludePatternContexts)
			{
				excludePatternContext.PopDirectory();
			}
			foreach (IPatternContext includePatternContext in _includePatternContexts)
			{
				includePatternContext.PopDirectory();
			}
		}

		private void PushDirectory(DirectoryInfoBase directory)
		{
			foreach (IPatternContext includePatternContext in _includePatternContexts)
			{
				includePatternContext.PushDirectory(directory);
			}
			foreach (IPatternContext excludePatternContext in _excludePatternContexts)
			{
				excludePatternContext.PushDirectory(directory);
			}
		}
	}
	public struct PatternTestResult
	{
		public static readonly PatternTestResult Failed = new PatternTestResult(isSuccessful: false, null);

		public bool IsSuccessful { get; }

		public string? Stem { get; }

		private PatternTestResult(bool isSuccessful, string stem)
		{
			IsSuccessful = isSuccessful;
			Stem = stem;
		}

		public static PatternTestResult Success(string? stem)
		{
			return new PatternTestResult(isSuccessful: true, stem);
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Internal.Patterns
{
	public class PatternBuilder
	{
		private sealed class LinearPattern : ILinearPattern, IPattern
		{
			public IList<IPathSegment> Segments { get; }

			public LinearPattern(List<IPathSegment> allSegments)
			{
				Segments = allSegments;
			}

			public IPatternContext CreatePatternContextForInclude()
			{
				return new PatternContextLinearInclude(this);
			}

			public IPatternContext CreatePatternContextForExclude()
			{
				return new PatternContextLinearExclude(this);
			}
		}

		private sealed class RaggedPattern : IRaggedPattern, IPattern
		{
			public IList<IList<IPathSegment>> Contains { get; }

			public IList<IPathSegment> EndsWith { get; }

			public IList<IPathSegment> Segments { get; }

			public IList<IPathSegment> StartsWith { get; }

			public RaggedPattern(List<IPathSegment> allSegments, IList<IPathSegment> segmentsPatternStartsWith, IList<IPathSegment> segmentsPatternEndsWith, IList<IList<IPathSegment>> segmentsPatternContains)
			{
				Segments = allSegments;
				StartsWith = segmentsPatternStartsWith;
				Contains = segmentsPatternContains;
				EndsWith = segmentsPatternEndsWith;
			}

			public IPatternContext CreatePatternContextForInclude()
			{
				return new PatternContextRaggedInclude(this);
			}

			public IPatternContext CreatePatternContextForExclude()
			{
				return new PatternContextRaggedExclude(this);
			}
		}

		private static readonly char[] _slashes = new char[2] { '/', '\\' };

		private static readonly char[] _star = new char[1] { '*' };

		public StringComparison ComparisonType { get; }

		public PatternBuilder()
		{
			ComparisonType = StringComparison.OrdinalIgnoreCase;
		}

		public PatternBuilder(StringComparison comparisonType)
		{
			ComparisonType = comparisonType;
		}

		public IPattern Build(string pattern)
		{
			System.ThrowHelper.ThrowIfNull(pattern, "pattern");
			pattern = pattern.TrimStart(_slashes);
			if (pattern.TrimEnd(_slashes).Length < pattern.Length)
			{
				pattern = pattern.TrimEnd(_slashes) + "/**";
			}
			List<IPathSegment> list = new List<IPathSegment>();
			bool flag = true;
			IList<IPathSegment> list2 = null;
			IList<IList<IPathSegment>> list3 = null;
			IList<IPathSegment> list4 = null;
			int length = pattern.Length;
			int num = 0;
			while (num < length)
			{
				int num2 = num;
				int num3 = NextIndex(pattern, _slashes, num, length);
				IPathSegment pathSegment = null;
				if (pathSegment == null && num3 - num2 == 3 && pattern[num2] == '*' && pattern[num2 + 1] == '.' && pattern[num2 + 2] == '*')
				{
					num2 += 2;
				}
				if (pathSegment == null && num3 - num2 == 2)
				{
					if (pattern[num2] == '*' && pattern[num2 + 1] == '*')
					{
						pathSegment = new RecursiveWildcardSegment();
					}
					else if (pattern[num2] == '.' && pattern[num2 + 1] == '.')
					{
						if (!flag)
						{
							throw new ArgumentException("\"..\" can be only added at the beginning of the pattern.");
						}
						pathSegment = new ParentPathSegment();
					}
				}
				if (pathSegment == null && num3 - num2 == 1 && pattern[num2] == '.')
				{
					pathSegment = new CurrentPathSegment();
				}
				if (pathSegment == null && num3 - num2 > 2 && pattern[num2] == '*' && pattern[num2 + 1] == '*' && pattern[num2 + 2] == '.')
				{
					pathSegment = new RecursiveWildcardSegment();
					num3 = num2;
				}
				if (pathSegment == null)
				{
					string beginsWith = string.Empty;
					List<string> list5 = new List<string>();
					string endsWith = string.Empty;
					int num4 = num2;
					while (num4 < num3)
					{
						int num5 = num4;
						int num6 = NextIndex(pattern, _star, num4, num3);
						if (num5 == num2)
						{
							if (num6 == num3)
							{
								pathSegment = new LiteralPathSegment(Portion(pattern, num5, num6), ComparisonType);
							}
							else
							{
								beginsWith = Portion(pattern, num5, num6);
							}
						}
						else if (num6 == num3)
						{
							endsWith = Portion(pattern, num5, num6);
						}
						else if (num5 != num6)
						{
							list5.Add(Portion(pattern, num5, num6));
						}
						num4 = num6 + 1;
					}
					if (pathSegment == null)
					{
						pathSegment = new WildcardPathSegment(beginsWith, list5, endsWith, ComparisonType);
					}
				}
				if (!(pathSegment is ParentPathSegment))
				{
					flag = false;
				}
				if (!(pathSegment is CurrentPathSegment))
				{
					if (pathSegment is RecursiveWildcardSegment)
					{
						if (list2 == null)
						{
							list2 = new List<IPathSegment>(list);
							list4 = new List<IPathSegment>();
							list3 = new List<IList<IPathSegment>>();
						}
						else if (list4.Count != 0)
						{
							list3.Add(list4);
							list4 = new List<IPathSegment>();
						}
					}
					else
					{
						list4?.Add(pathSegment);
					}
					list.Add(pathSegment);
				}
				num = num3 + 1;
			}
			if (list2 == null)
			{
				return new LinearPattern(list);
			}
			return new RaggedPattern(list, list2, list4, list3);
		}

		private static int NextIndex(string pattern, char[] anyOf, int beginIndex, int endIndex)
		{
			int num = pattern.IndexOfAny(anyOf, beginIndex, endIndex - beginIndex);
			if (num != -1)
			{
				return num;
			}
			return endIndex;
		}

		private static string Portion(string pattern, int beginIndex, int endIndex)
		{
			return pattern.Substring(beginIndex, endIndex - beginIndex);
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PatternContexts
{
	public abstract class PatternContext<TFrame> : IPatternContext where TFrame : struct
	{
		private Stack<TFrame> _stack = new Stack<TFrame>();

		protected TFrame Frame;

		public virtual void Declare(Action<IPathSegment, bool> declare)
		{
		}

		public abstract PatternTestResult Test(FileInfoBase file);

		public abstract bool Test(DirectoryInfoBase directory);

		public abstract void PushDirectory(DirectoryInfoBase directory);

		public virtual void PopDirectory()
		{
			Frame = _stack.Pop();
		}

		protected void PushDataFrame(TFrame frame)
		{
			_stack.Push(Frame);
			Frame = frame;
		}

		protected bool IsStackEmpty()
		{
			return _stack.Count == 0;
		}
	}
	public abstract class PatternContextLinear : PatternContext<PatternContextLinear.FrameData>
	{
		public struct FrameData
		{
			public bool IsNotApplicable;

			public int SegmentIndex;

			public bool InStem;

			private IList<string> _stemItems;

			public IList<string> StemItems => _stemItems ?? (_stemItems = new List<string>());

			public string? Stem
			{
				get
				{
					if (_stemItems != null)
					{
						return string.Join("/", _stemItems);
					}
					return null;
				}
			}
		}

		protected ILinearPattern Pattern { get; }

		public PatternContextLinear(ILinearPattern pattern)
		{
			System.ThrowHelper.ThrowIfNull(pattern, "pattern");
			Pattern = pattern;
		}

		public override PatternTestResult Test(FileInfoBase file)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestFile);
			}
			if (!Frame.IsNotApplicable && IsLastSegment() && TestMatchingSegment(file.Name))
			{
				return PatternTestResult.Success(CalculateStem(file));
			}
			return PatternTestResult.Failed;
		}

		public override void PushDirectory(DirectoryInfoBase directory)
		{
			FrameData frame = Frame;
			if (!IsStackEmpty() && !Frame.IsNotApplicable)
			{
				if (!TestMatchingSegment(directory.Name))
				{
					frame.IsNotApplicable = true;
				}
				else
				{
					IPathSegment pathSegment = Pattern.Segments[Frame.SegmentIndex];
					if (frame.InStem || pathSegment.CanProduceStem)
					{
						frame.InStem = true;
						frame.StemItems.Add(directory.Name);
					}
					frame.SegmentIndex++;
				}
			}
			PushDataFrame(frame);
		}

		protected bool IsLastSegment()
		{
			return Frame.SegmentIndex == Pattern.Segments.Count - 1;
		}

		protected bool TestMatchingSegment(string value)
		{
			if (Frame.SegmentIndex >= Pattern.Segments.Count)
			{
				return false;
			}
			return Pattern.Segments[Frame.SegmentIndex].Match(value);
		}

		protected string CalculateStem(FileInfoBase matchedFile)
		{
			return MatcherContext.CombinePath(Frame.Stem, matchedFile.Name);
		}
	}
	public class PatternContextLinearExclude : PatternContextLinear
	{
		public PatternContextLinearExclude(ILinearPattern pattern)
			: base(pattern)
		{
		}

		public override bool Test(DirectoryInfoBase directory)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestDirectory);
			}
			if (Frame.IsNotApplicable)
			{
				return false;
			}
			if (IsLastSegment())
			{
				return TestMatchingSegment(directory.Name);
			}
			return false;
		}
	}
	public class PatternContextLinearInclude : PatternContextLinear
	{
		public PatternContextLinearInclude(ILinearPattern pattern)
			: base(pattern)
		{
		}

		public override void Declare(Action<IPathSegment, bool> onDeclare)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotDeclarePathSegment);
			}
			if (!Frame.IsNotApplicable && Frame.SegmentIndex < base.Pattern.Segments.Count)
			{
				onDeclare(base.Pattern.Segments[Frame.SegmentIndex], IsLastSegment());
			}
		}

		public override bool Test(DirectoryInfoBase directory)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestDirectory);
			}
			if (Frame.IsNotApplicable)
			{
				return false;
			}
			if (!IsLastSegment())
			{
				return TestMatchingSegment(directory.Name);
			}
			return false;
		}
	}
	public abstract class PatternContextRagged : PatternContext<PatternContextRagged.FrameData>
	{
		public struct FrameData
		{
			public bool IsNotApplicable;

			public int SegmentGroupIndex;

			public IList<IPathSegment> SegmentGroup;

			public int BacktrackAvailable;

			public int SegmentIndex;

			public bool InStem;

			private IList<string> _stemItems;

			public IList<string> StemItems => _stemItems ?? (_stemItems = new List<string>());

			public string? Stem
			{
				get
				{
					if (_stemItems != null)
					{
						return string.Join("/", _stemItems);
					}
					return null;
				}
			}
		}

		protected IRaggedPattern Pattern { get; }

		public PatternContextRagged(IRaggedPattern pattern)
		{
			System.ThrowHelper.ThrowIfNull(pattern, "pattern");
			Pattern = pattern;
		}

		public override PatternTestResult Test(FileInfoBase file)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestFile);
			}
			if (!Frame.IsNotApplicable && IsEndingGroup() && TestMatchingGroup(file))
			{
				return PatternTestResult.Success(CalculateStem(file));
			}
			return PatternTestResult.Failed;
		}

		public sealed override void PushDirectory(DirectoryInfoBase directory)
		{
			FrameData frame = Frame;
			if (IsStackEmpty())
			{
				frame.SegmentGroupIndex = -1;
				frame.SegmentGroup = Pattern.StartsWith;
			}
			else if (!Frame.IsNotApplicable)
			{
				if (IsStartingGroup())
				{
					if (!TestMatchingSegment(directory.Name))
					{
						frame.IsNotApplicable = true;
					}
					else
					{
						frame.SegmentIndex++;
					}
				}
				else if (!IsStartingGroup() && directory.Name == "..")
				{
					frame.IsNotApplicable = true;
				}
				else if (!IsStartingGroup() && !IsEndingGroup() && TestMatchingGroup(directory))
				{
					frame.SegmentIndex = Frame.SegmentGroup.Count;
					frame.BacktrackAvailable = 0;
				}
				else
				{
					frame.BacktrackAvailable++;
				}
			}
			if (frame.InStem)
			{
				frame.StemItems.Add(directory.Name);
			}
			while (frame.SegmentIndex == frame.SegmentGroup.Count && frame.SegmentGroupIndex != Pattern.Contains.Count)
			{
				frame.SegmentGroupIndex++;
				frame.SegmentIndex = 0;
				if (frame.SegmentGroupIndex < Pattern.Contains.Count)
				{
					frame.SegmentGroup = Pattern.Contains[frame.SegmentGroupIndex];
				}
				else
				{
					frame.SegmentGroup = Pattern.EndsWith;
				}
				frame.InStem = true;
			}
			PushDataFrame(frame);
		}

		public override void PopDirectory()
		{
			base.PopDirectory();
			if (Frame.StemItems.Count > 0)
			{
				Frame.StemItems.RemoveAt(Frame.StemItems.Count - 1);
			}
		}

		protected bool IsStartingGroup()
		{
			return Frame.SegmentGroupIndex == -1;
		}

		protected bool IsEndingGroup()
		{
			return Frame.SegmentGroupIndex == Pattern.Contains.Count;
		}

		protected bool TestMatchingSegment(string value)
		{
			if (Frame.SegmentIndex >= Frame.SegmentGroup.Count)
			{
				return false;
			}
			return Frame.SegmentGroup[Frame.SegmentIndex].Match(value);
		}

		protected bool TestMatchingGroup(FileSystemInfoBase value)
		{
			int count = Frame.SegmentGroup.Count;
			int num = Frame.BacktrackAvailable + 1;
			if (num < count)
			{
				return false;
			}
			FileSystemInfoBase fileSystemInfoBase = value;
			for (int i = 0; i != count; i++)
			{
				IPathSegment pathSegment = Frame.SegmentGroup[count - i - 1];
				if (fileSystemInfoBase == null || !pathSegment.Match(fileSystemInfoBase.Name))
				{
					return false;
				}
				fileSystemInfoBase = fileSystemInfoBase.ParentDirectory;
			}
			return true;
		}

		protected string CalculateStem(FileInfoBase matchedFile)
		{
			return MatcherContext.CombinePath(Frame.Stem, matchedFile.Name);
		}
	}
	public class PatternContextRaggedExclude : PatternContextRagged
	{
		public PatternContextRaggedExclude(IRaggedPattern pattern)
			: base(pattern)
		{
		}

		public override bool Test(DirectoryInfoBase directory)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestDirectory);
			}
			if (Frame.IsNotApplicable)
			{
				return false;
			}
			if (IsEndingGroup() && TestMatchingGroup(directory))
			{
				return true;
			}
			if (base.Pattern.EndsWith.Count == 0 && Frame.SegmentGroupIndex == base.Pattern.Contains.Count - 1 && TestMatchingGroup(directory))
			{
				return true;
			}
			return false;
		}
	}
	public class PatternContextRaggedInclude : PatternContextRagged
	{
		public PatternContextRaggedInclude(IRaggedPattern pattern)
			: base(pattern)
		{
		}

		public override void Declare(Action<IPathSegment, bool> onDeclare)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotDeclarePathSegment);
			}
			if (!Frame.IsNotApplicable)
			{
				if (IsStartingGroup() && Frame.SegmentIndex < Frame.SegmentGroup.Count)
				{
					onDeclare(Frame.SegmentGroup[Frame.SegmentIndex], arg2: false);
				}
				else
				{
					onDeclare(WildcardPathSegment.MatchAll, arg2: false);
				}
			}
		}

		public override bool Test(DirectoryInfoBase directory)
		{
			if (IsStackEmpty())
			{
				throw new InvalidOperationException(System.SR.CannotTestDirectory);
			}
			if (Frame.IsNotApplicable)
			{
				return false;
			}
			if (IsStartingGroup() && !TestMatchingSegment(directory.Name))
			{
				return false;
			}
			return true;
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments
{
	public class CurrentPathSegment : IPathSegment
	{
		public bool CanProduceStem => false;

		public bool Match(string value)
		{
			return false;
		}
	}
	public class LiteralPathSegment : IPathSegment
	{
		private readonly StringComparison _comparisonType;

		public bool CanProduceStem => false;

		public string Value { get; }

		public LiteralPathSegment(string value, StringComparison comparisonType)
		{
			System.ThrowHelper.ThrowIfNull(value, "value");
			Value = value;
			_comparisonType = comparisonType;
		}

		public bool Match(string value)
		{
			return string.Equals(Value, value, _comparisonType);
		}

		public override bool Equals([NotNullWhen(true)] object? obj)
		{
			if (obj is LiteralPathSegment literalPathSegment && _comparisonType == literalPathSegment._comparisonType)
			{
				return string.Equals(literalPathSegment.Value, Value, _comparisonType);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return StringComparisonHelper.GetStringComparer(_comparisonType).GetHashCode(Value);
		}
	}
	public class ParentPathSegment : IPathSegment
	{
		private const string LiteralParent = "..";

		public bool CanProduceStem => false;

		public bool Match(string value)
		{
			return string.Equals("..", value, StringComparison.Ordinal);
		}
	}
	public class RecursiveWildcardSegment : IPathSegment
	{
		public bool CanProduceStem => true;

		public bool Match(string value)
		{
			return false;
		}
	}
	public class WildcardPathSegment : IPathSegment
	{
		public static readonly WildcardPathSegment MatchAll = new WildcardPathSegment(string.Empty, new List<string>(), string.Empty, StringComparison.OrdinalIgnoreCase);

		private readonly StringComparison _comparisonType;

		public bool CanProduceStem => true;

		public string BeginsWith { get; }

		public List<string> Contains { get; }

		public string EndsWith { get; }

		public WildcardPathSegment(string beginsWith, List<string> contains, string endsWith, StringComparison comparisonType)
		{
			System.ThrowHelper.ThrowIfNull(beginsWith, "beginsWith");
			System.ThrowHelper.ThrowIfNull(contains, "contains");
			System.ThrowHelper.ThrowIfNull(endsWith, "endsWith");
			if ((uint)(comparisonType - 4) > 1u)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.StringComparisonTypeShouldBeOrdinal, comparisonType));
			}
			_comparisonType = comparisonType;
			BeginsWith = beginsWith;
			Contains = contains;
			EndsWith = endsWith;
		}

		public bool Match(string value)
		{
			if (value.Length < BeginsWith.Length + EndsWith.Length)
			{
				return false;
			}
			if (!value.StartsWith(BeginsWith, _comparisonType))
			{
				return false;
			}
			if (!value.EndsWith(EndsWith, _comparisonType))
			{
				return false;
			}
			int num = BeginsWith.Length;
			int num2 = value.Length - EndsWith.Length;
			for (int i = 0; i != Contains.Count; i++)
			{
				string text = Contains[i];
				int num3 = value.IndexOf(text, num, num2 - num, _comparisonType);
				if (num3 == -1)
				{
					return false;
				}
				num = num3 + text.Length;
			}
			return true;
		}
	}
}
namespace Microsoft.Extensions.FileSystemGlobbing.Abstractions
{
	public abstract class DirectoryInfoBase : FileSystemInfoBase
	{
		public abstract IEnumerable<FileSystemInfoBase> EnumerateFileSystemInfos();

		public abstract DirectoryInfoBase? GetDirectory(string path);

		public abstract FileInfoBase? GetFile(string path);
	}
	public class DirectoryInfoWrapper : DirectoryInfoBase
	{
		private readonly DirectoryInfo _directoryInfo;

		private readonly bool _isParentPath;

		public override string Name
		{
			get
			{
				if (!_isParentPath)
				{
					return _directoryInfo.Name;
				}
				return "..";
			}
		}

		public override string FullName => _directoryInfo.FullName;

		public override DirectoryInfoBase? ParentDirectory => new DirectoryInfoWrapper(_directoryInfo.Parent);

		public DirectoryInfoWrapper(DirectoryInfo directoryInfo)
			: this(directoryInfo, isParentPath: false)
		{
		}

		private DirectoryInfoWrapper(DirectoryInfo directoryInfo, bool isParentPath)
		{
			_directoryInfo = directoryInfo;
			_isParentPath = isParentPath;
		}

		public override IEnumerable<FileSystemInfoBase> EnumerateFileSystemInfos()
		{
			if (!_directoryInfo.Exists)
			{
				yield break;
			}
			IEnumerable<FileSystemInfo> enumerable;
			try
			{
				enumerable = _directoryInfo.EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly);
			}
			catch (DirectoryNotFoundException)
			{
				yield break;
			}
			foreach (FileSystemInfo item in enumerable)
			{
				if (item is DirectoryInfo directoryInfo)
				{
					yield return new DirectoryInfoWrapper(directoryInfo);
				}
				else
				{
					yield return new FileInfoWrapper((FileInfo)item);
				}
			}
		}

		public override DirectoryInfoBase? GetDirectory(string name)
		{
			bool flag = string.Equals(name, "..", StringComparison.Ordinal);
			if (flag)
			{
				return new DirectoryInfoWrapper(new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), flag);
			}
			DirectoryInfo[] directories = _directoryInfo.GetDirectories(name);
			if (directories.Length == 1)
			{
				return new DirectoryInfoWrapper(directories[0], flag);
			}
			if (directories.Length == 0)
			{
				return null;
			}
			throw new InvalidOperationException("More than one sub directories are found under " + _directoryInfo.FullName + " with name " + name + ".");
		}

		public override FileInfoBase GetFile(string name)
		{
			return new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name)));
		}
	}
	public abstract class FileInfoBase : FileSystemInfoBase
	{
	}
	public class FileInfoWrapper : FileInfoBase
	{
		private readonly FileInfo _fileInfo;

		public override string Name => _fileInfo.Name;

		public override string FullName => _fileInfo.FullName;

		public override DirectoryInfoBase? ParentDirectory => new DirectoryInfoWrapper(_fileInfo.Directory);

		public FileInfoWrapper(FileInfo fileInfo)
		{
			System.ThrowHelper.ThrowIfNull(fileInfo, "fileInfo");
			_fileInfo = fileInfo;
		}
	}
	public abstract class FileSystemInfoBase
	{
		public abstract string Name { get; }

		public abstract string FullName { get; }

		public abstract DirectoryInfoBase? ParentDirectory { get; }
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Hosting.Abstractions.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.Hosting.Abstractions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Hosting.Abstractions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Hosting and startup abstractions for applications.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Hosting.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Hosting.Abstractions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string HostAbortedExceptionMessage => GetResourceString("HostAbortedExceptionMessage");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.DependencyInjection
{
	public static class ServiceCollectionHostedServiceExtensions
	{
		public static IServiceCollection AddHostedService<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THostedService>(this IServiceCollection services) where THostedService : class, IHostedService
		{
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(services, ServiceDescriptor.Singleton<IHostedService, THostedService>());
			return services;
		}

		public static IServiceCollection AddHostedService<THostedService>(this IServiceCollection services, Func<IServiceProvider, THostedService> implementationFactory) where THostedService : class, IHostedService
		{
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(services, ServiceDescriptor.Singleton<IHostedService>((Func<IServiceProvider, IHostedService>)implementationFactory));
			return services;
		}
	}
}
namespace Microsoft.Extensions.Hosting
{
	public abstract class BackgroundService : IHostedService, IDisposable
	{
		private Task _executeTask;

		private CancellationTokenSource _stoppingCts;

		public virtual Task? ExecuteTask => _executeTask;

		protected abstract Task ExecuteAsync(CancellationToken stoppingToken);

		public virtual Task StartAsync(CancellationToken cancellationToken)
		{
			_stoppingCts = CancellationTokenSource.CreateLinkedTokenSource(new CancellationToken[1] { cancellationToken });
			_executeTask = ExecuteAsync(_stoppingCts.Token);
			if (_executeTask.IsCompleted)
			{
				return _executeTask;
			}
			return Task.CompletedTask;
		}

		public virtual async Task StopAsync(CancellationToken cancellationToken)
		{
			if (_executeTask != null)
			{
				try
				{
					_stoppingCts.Cancel();
				}
				finally
				{
					await Task.WhenAny(new Task[2]
					{
						_executeTask,
						Task.Delay(-1, cancellationToken)
					}).ConfigureAwait(continueOnCapturedContext: false);
				}
			}
		}

		public virtual void Dispose()
		{
			_stoppingCts?.Cancel();
		}
	}
	[Obsolete("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")]
	public static class EnvironmentName
	{
		public static readonly string Development = "Development";

		public static readonly string Staging = "Staging";

		public static readonly string Production = "Production";
	}
	public static class Environments
	{
		public static readonly string Development = "Development";

		public static readonly string Staging = "Staging";

		public static readonly string Production = "Production";
	}
	[Serializable]
	public sealed class HostAbortedException : Exception
	{
		private HostAbortedException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		public HostAbortedException()
			: base(System.SR.HostAbortedExceptionMessage)
		{
		}

		public HostAbortedException(string? message)
			: base(message)
		{
		}

		public HostAbortedException(string? message, Exception? innerException)
			: base(message, innerException)
		{
		}
	}
	public class HostBuilderContext
	{
		public IHostEnvironment HostingEnvironment { get; set; }

		public IConfiguration Configuration { get; set; }

		public IDictionary<object, object> Properties { get; }

		public HostBuilderContext(IDictionary<object, object> properties)
		{
			System.ThrowHelper.ThrowIfNull(properties, "properties");
			Properties = properties;
		}
	}
	public static class HostDefaults
	{
		public static readonly string ApplicationKey = "applicationName";

		public static readonly string EnvironmentKey = "environment";

		public static readonly string ContentRootKey = "contentRoot";
	}
	public static class HostEnvironmentEnvExtensions
	{
		public static bool IsDevelopment(this IHostEnvironment hostEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostEnvironment, "hostEnvironment");
			return hostEnvironment.IsEnvironment(Environments.Development);
		}

		public static bool IsStaging(this IHostEnvironment hostEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostEnvironment, "hostEnvironment");
			return hostEnvironment.IsEnvironment(Environments.Staging);
		}

		public static bool IsProduction(this IHostEnvironment hostEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostEnvironment, "hostEnvironment");
			return hostEnvironment.IsEnvironment(Environments.Production);
		}

		public static bool IsEnvironment(this IHostEnvironment hostEnvironment, string environmentName)
		{
			System.ThrowHelper.ThrowIfNull(hostEnvironment, "hostEnvironment");
			return string.Equals(hostEnvironment.EnvironmentName, environmentName, StringComparison.OrdinalIgnoreCase);
		}
	}
	public static class HostingAbstractionsHostBuilderExtensions
	{
		public static IHost Start(this IHostBuilder hostBuilder)
		{
			return hostBuilder.StartAsync().GetAwaiter().GetResult();
		}

		public static async Task<IHost> StartAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default(CancellationToken))
		{
			IHost host = hostBuilder.Build();
			await host.StartAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			return host;
		}
	}
	public static class HostingAbstractionsHostExtensions
	{
		public static void Start(this IHost host)
		{
			host.StartAsync().GetAwaiter().GetResult();
		}

		public static async Task StopAsync(this IHost host, TimeSpan timeout)
		{
			using CancellationTokenSource cts = new CancellationTokenSource(timeout);
			await host.StopAsync(cts.Token).ConfigureAwait(continueOnCapturedContext: false);
		}

		public static void WaitForShutdown(this IHost host)
		{
			host.WaitForShutdownAsync().GetAwaiter().GetResult();
		}

		public static void Run(this IHost host)
		{
			host.RunAsync().GetAwaiter().GetResult();
		}

		public static async Task RunAsync(this IHost host, CancellationToken token = default(CancellationToken))
		{
			try
			{
				await host.StartAsync(token).ConfigureAwait(continueOnCapturedContext: false);
				await host.WaitForShutdownAsync(token).ConfigureAwait(continueOnCapturedContext: false);
			}
			finally
			{
				if (host is IAsyncDisposable asyncDisposable)
				{
					await asyncDisposable.DisposeAsync().ConfigureAwait(continueOnCapturedContext: false);
				}
				else
				{
					host.Dispose();
				}
			}
		}

		public static async Task WaitForShutdownAsync(this IHost host, CancellationToken token = default(CancellationToken))
		{
			IHostApplicationLifetime requiredService = ServiceProviderServiceExtensions.GetRequiredService<IHostApplicationLifetime>(host.Services);
			token.Register(delegate(object state)
			{
				((IHostApplicationLifetime)state).StopApplication();
			}, requiredService);
			TaskCompletionSource<object> taskCompletionSource = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
			requiredService.ApplicationStopping.Register(delegate(object obj)
			{
				TaskCompletionSource<object> taskCompletionSource2 = (TaskCompletionSource<object>)obj;
				taskCompletionSource2.TrySetResult(null);
			}, taskCompletionSource);
			await taskCompletionSource.Task.ConfigureAwait(continueOnCapturedContext: false);
			await host.StopAsync(CancellationToken.None).ConfigureAwait(continueOnCapturedContext: false);
		}
	}
	public static class HostingEnvironmentExtensions
	{
		public static bool IsDevelopment(this IHostingEnvironment hostingEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostingEnvironment, "hostingEnvironment");
			return hostingEnvironment.IsEnvironment(EnvironmentName.Development);
		}

		public static bool IsStaging(this IHostingEnvironment hostingEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostingEnvironment, "hostingEnvironment");
			return hostingEnvironment.IsEnvironment(EnvironmentName.Staging);
		}

		public static bool IsProduction(this IHostingEnvironment hostingEnvironment)
		{
			System.ThrowHelper.ThrowIfNull(hostingEnvironment, "hostingEnvironment");
			return hostingEnvironment.IsEnvironment(EnvironmentName.Production);
		}

		public static bool IsEnvironment(this IHostingEnvironment hostingEnvironment, string environmentName)
		{
			System.ThrowHelper.ThrowIfNull(hostingEnvironment, "hostingEnvironment");
			return string.Equals(hostingEnvironment.EnvironmentName, environmentName, StringComparison.OrdinalIgnoreCase);
		}
	}
	[Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
	public interface IApplicationLifetime
	{
		CancellationToken ApplicationStarted { get; }

		CancellationToken ApplicationStopping { get; }

		CancellationToken ApplicationStopped { get; }

		void StopApplication();
	}
	public interface IHost : IDisposable
	{
		IServiceProvider Services { get; }

		Task StartAsync(CancellationToken cancellationToken = default(CancellationToken));

		Task StopAsync(CancellationToken cancellationToken = default(CancellationToken));
	}
	public interface IHostApplicationLifetime
	{
		CancellationToken ApplicationStarted { get; }

		CancellationToken ApplicationStopping { get; }

		CancellationToken ApplicationStopped { get; }

		void StopApplication();
	}
	public interface IHostBuilder
	{
		IDictionary<object, object> Properties { get; }

		IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate);

		IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate);

		IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate);

		IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull;

		IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull;

		IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate);

		IHost Build();
	}
	public interface IHostedService
	{
		Task StartAsync(CancellationToken cancellationToken);

		Task StopAsync(CancellationToken cancellationToken);
	}
	public interface IHostEnvironment
	{
		string EnvironmentName { get; set; }

		string ApplicationName { get; set; }

		string ContentRootPath { get; set; }

		IFileProvider ContentRootFileProvider { get; set; }
	}
	[Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
	public interface IHostingEnvironment
	{
		string EnvironmentName { get; set; }

		string ApplicationName { get; set; }

		string ContentRootPath { get; set; }

		IFileProvider ContentRootFileProvider { get; set; }
	}
	public interface IHostLifetime
	{
		Task WaitForStartAsync(CancellationToken cancellationToken);

		Task StopAsync(CancellationToken cancellationToken);
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Hosting.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.Hosting;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Logging.EventLog;
using Microsoft.Extensions.Options;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Hosting")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Hosting and startup infrastructures for applications.")]
[assembly: AssemblyFileVersion("7.0.323.6910")]
[assembly: AssemblyInformationalVersion("7.0.3+0a2bda10e81d901396c3cff95533529e3a93ad47")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Hosting")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.1")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Hosting
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string ApplicationNameChangeNotSupported => GetResourceString("ApplicationNameChangeNotSupported");

		internal static string BackgroundServiceExceptionStoppedHost => GetResourceString("BackgroundServiceExceptionStoppedHost");

		internal static string BuildCalled => GetResourceString("BuildCalled");

		internal static string ContentRootChangeNotSupported => GetResourceString("ContentRootChangeNotSupported");

		internal static string CreateBuilderCallBeforeCreateServiceProvider => GetResourceString("CreateBuilderCallBeforeCreateServiceProvider");

		internal static string EnvironmentNameChangeNotSupoprted => GetResourceString("EnvironmentNameChangeNotSupoprted");

		internal static string IHostApplicationLifetimeReplacementNotSupported => GetResourceString("IHostApplicationLifetimeReplacementNotSupported");

		internal static string NullIServiceProvider => GetResourceString("NullIServiceProvider");

		internal static string ResolverReturnedNull => GetResourceString("ResolverReturnedNull");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string Scope { get; set; }

		public string Target { get; set; }

		public string MessageId { get; set; }

		public string Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.Versioning
{
	internal abstract class OSPlatformAttribute : Attribute
	{
		public string PlatformName { get; }

		private protected OSPlatformAttribute(string platformName)
		{
			PlatformName = platformName;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
	internal sealed class TargetPlatformAttribute : OSPlatformAttribute
	{
		public TargetPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public string Message { get; }

		public UnsupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public UnsupportedOSPlatformAttribute(string platformName, string message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class ObsoletedOSPlatformAttribute : OSPlatformAttribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public ObsoletedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public ObsoletedOSPlatformAttribute(string platformName, string message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public UnsupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.DependencyInjection
{
	[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2091:UnrecognizedReflectionPattern", Justification = "Workaround for https://github.com/mono/linker/issues/1416. Outer method has been annotated with DynamicallyAccessedMembers.")]
	public static class OptionsBuilderExtensions
	{
		public static OptionsBuilder<TOptions> ValidateOnStart<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TOptions>(this OptionsBuilder<TOptions> optionsBuilder) where TOptions : class
		{
			OptionsBuilder<TOptions> optionsBuilder2 = optionsBuilder;
			System.ThrowHelper.ThrowIfNull(optionsBuilder2, "optionsBuilder");
			ServiceCollectionHostedServiceExtensions.AddHostedService<ValidationHostedService>(optionsBuilder2.Services);
			OptionsServiceCollectionExtensions.AddOptions<ValidatorOptions>(optionsBuilder2.Services).Configure<IOptionsMonitor<TOptions>>((Action<ValidatorOptions, IOptionsMonitor<TOptions>>)delegate(ValidatorOptions vo, IOptionsMonitor<TOptions> options)
			{
				vo.Validators[(typeof(TOptions), optionsBuilder2.Name)] = delegate
				{
					options.Get(optionsBuilder2.Name);
				};
			});
			return optionsBuilder2;
		}
	}
	internal sealed class ValidationHostedService : IHostedService
	{
		private readonly IDictionary<(Type, string), Action> _validators;

		public ValidationHostedService(IOptions<ValidatorOptions> validatorOptions)
		{
			_validators = validatorOptions?.Value?.Validators ?? throw new ArgumentNullException("validatorOptions");
		}

		public Task StartAsync(CancellationToken cancellationToken)
		{
			//IL_0029: Expected O, but got Unknown
			List<Exception> list = new List<Exception>();
			foreach (Action value in _validators.Values)
			{
				try
				{
					value();
				}
				catch (OptionsValidationException val)
				{
					OptionsValidationException item = val;
					list.Add((Exception)(object)item);
				}
			}
			if (list.Count == 1)
			{
				ExceptionDispatchInfo.Capture(list[0]).Throw();
			}
			if (list.Count > 1)
			{
				throw new AggregateException(list);
			}
			return Task.CompletedTask;
		}

		public Task StopAsync(CancellationToken cancellationToken)
		{
			return Task.CompletedTask;
		}
	}
	internal sealed class ValidatorOptions
	{
		public IDictionary<(Type optionsType, string optionsName), Action> Validators { get; } = new Dictionary<(Type, string), Action>();

	}
}
namespace Microsoft.Extensions.Hosting
{
	public enum BackgroundServiceExceptionBehavior
	{
		StopHost,
		Ignore
	}
	public class ConsoleLifetimeOptions
	{
		public bool SuppressStatusMessages { get; set; }
	}
	public static class Host
	{
		internal const string RequiresDynamicCodeMessage = "Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.";

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static IHostBuilder CreateDefaultBuilder()
		{
			return CreateDefaultBuilder(null);
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static IHostBuilder CreateDefaultBuilder(string[]? args)
		{
			HostBuilder builder = new HostBuilder();
			return ((IHostBuilder)(object)builder).ConfigureDefaults(args);
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static HostApplicationBuilder CreateApplicationBuilder()
		{
			return new HostApplicationBuilder();
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static HostApplicationBuilder CreateApplicationBuilder(string[]? args)
		{
			return new HostApplicationBuilder(args);
		}
	}
	public sealed class HostApplicationBuilder
	{
		private sealed class HostBuilderAdapter : IHostBuilder
		{
			private readonly HostApplicationBuilder _hostApplicationBuilder;

			private readonly List<Action<IConfigurationBuilder>> _configureHostConfigActions = new List<Action<IConfigurationBuilder>>();

			private readonly List<Action<HostBuilderContext, IConfigurationBuilder>> _configureAppConfigActions = new List<Action<HostBuilderContext, IConfigurationBuilder>>();

			private readonly List<IConfigureContainerAdapter> _configureContainerActions = new List<IConfigureContainerAdapter>();

			private readonly List<Action<HostBuilderContext, IServiceCollection>> _configureServicesActions = new List<Action<HostBuilderContext, IServiceCollection>>();

			private IServiceFactoryAdapter _serviceProviderFactory;

			public IDictionary<object, object> Properties => _hostApplicationBuilder._hostBuilderContext.Properties;

			public HostBuilderAdapter(HostApplicationBuilder hostApplicationBuilder)
			{
				_hostApplicationBuilder = hostApplicationBuilder;
			}

			public void ApplyChanges()
			{
				ConfigurationManager configuration = _hostApplicationBuilder.Configuration;
				if (_configureHostConfigActions.Count > 0)
				{
					string text = configuration[HostDefaults.ApplicationKey];
					string text2 = configuration[HostDefaults.EnvironmentKey];
					string text3 = configuration[HostDefaults.ContentRootKey];
					string contentRootPath = _hostApplicationBuilder._hostBuilderContext.HostingEnvironment.ContentRootPath;
					foreach (Action<IConfigurationBuilder> configureHostConfigAction in _configureHostConfigActions)
					{
						configureHostConfigAction((IConfigurationBuilder)(object)configuration);
					}
					if (!string.Equals(text, configuration[HostDefaults.ApplicationKey], StringComparison.OrdinalIgnoreCase))
					{
						throw new NotSupportedException(System.SR.Format(System.SR.ApplicationNameChangeNotSupported, text, configuration[HostDefaults.ApplicationKey]));
					}
					if (!string.Equals(text2, configuration[HostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase))
					{
						throw new NotSupportedException(System.SR.Format(System.SR.EnvironmentNameChangeNotSupoprted, text2, configuration[HostDefaults.EnvironmentKey]));
					}
					string text4 = configuration[HostDefaults.ContentRootKey];
					if (!string.Equals(text3, text4, StringComparison.OrdinalIgnoreCase) && !string.Equals(contentRootPath, HostBuilder.ResolveContentRootPath(text4, AppContext.BaseDirectory), StringComparison.OrdinalIgnoreCase))
					{
						throw new NotSupportedException(System.SR.Format(System.SR.ContentRootChangeNotSupported, text3, text4));
					}
				}
				foreach (Action<HostBuilderContext, IConfigurationBuilder> configureAppConfigAction in _configureAppConfigActions)
				{
					configureAppConfigAction(_hostApplicationBuilder._hostBuilderContext, (IConfigurationBuilder)(object)configuration);
				}
				foreach (Action<HostBuilderContext, IServiceCollection> configureServicesAction in _configureServicesActions)
				{
					configureServicesAction(_hostApplicationBuilder._hostBuilderContext, _hostApplicationBuilder.Services);
				}
				if (_configureContainerActions.Count > 0)
				{
					Action<object> previousConfigureContainer = _hostApplicationBuilder._configureContainer;
					_hostApplicationBuilder._configureContainer = delegate(object containerBuilder)
					{
						previousConfigureContainer(containerBuilder);
						foreach (IConfigureContainerAdapter configureContainerAction in _configureContainerActions)
						{
							configureContainerAction.ConfigureContainer(_hostApplicationBuilder._hostBuilderContext, containerBuilder);
						}
					};
				}
				if (_serviceProviderFactory != null)
				{
					_hostApplicationBuilder._createServiceProvider = delegate
					{
						object obj = _serviceProviderFactory.CreateBuilder(_hostApplicationBuilder.Services);
						_hostApplicationBuilder._configureContainer(obj);
						return _serviceProviderFactory.CreateServiceProvider(obj);
					};
				}
			}

			public IHost Build()
			{
				throw new NotSupportedException();
			}

			public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate)
			{
				System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
				_configureHostConfigActions.Add(configureDelegate);
				return (IHostBuilder)(object)this;
			}

			public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate)
			{
				System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
				_configureAppConfigActions.Add(configureDelegate);
				return (IHostBuilder)(object)this;
			}

			public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)
			{
				System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
				_configureServicesActions.Add(configureDelegate);
				return (IHostBuilder)(object)this;
			}

			public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory)
			{
				System.ThrowHelper.ThrowIfNull(factory, "factory");
				_serviceProviderFactory = new ServiceFactoryAdapter<TContainerBuilder>(factory);
				return (IHostBuilder)(object)this;
			}

			public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory)
			{
				System.ThrowHelper.ThrowIfNull(factory, "factory");
				_serviceProviderFactory = new ServiceFactoryAdapter<TContainerBuilder>(() => _hostApplicationBuilder._hostBuilderContext, factory);
				return (IHostBuilder)(object)this;
			}

			public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
			{
				System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
				_configureContainerActions.Add(new ConfigureContainerAdapter<TContainerBuilder>(configureDelegate));
				return (IHostBuilder)(object)this;
			}
		}

		private sealed class LoggingBuilder : ILoggingBuilder
		{
			public IServiceCollection Services { get; }

			public LoggingBuilder(IServiceCollection services)
			{
				Services = services;
			}
		}

		private readonly HostBuilderContext _hostBuilderContext;

		private readonly ServiceCollection _serviceCollection = new ServiceCollection();

		private Func<IServiceProvider> _createServiceProvider;

		private Action<object> _configureContainer = delegate
		{
		};

		private HostBuilderAdapter _hostBuilderAdapter;

		private IServiceProvider _appServices;

		private bool _hostBuilt;

		public IHostEnvironment Environment { get; }

		public ConfigurationManager Configuration { get; }

		public IServiceCollection Services => (IServiceCollection)(object)_serviceCollection;

		public ILoggingBuilder Logging { get; }

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public HostApplicationBuilder()
			: this((string[]?)null)
		{
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public HostApplicationBuilder(string[]? args)
			: this(new HostApplicationBuilderSettings
			{
				Args = args
			})
		{
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public HostApplicationBuilder(HostApplicationBuilderSettings? settings)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Expected O, but got Unknown
			if (settings == null)
			{
				settings = new HostApplicationBuilderSettings();
			}
			Configuration = (ConfigurationManager)(((object)settings.Configuration) ?? ((object)new ConfigurationManager()));
			if (!settings.DisableDefaults)
			{
				if (settings.ContentRootPath == null && Configuration[HostDefaults.ContentRootKey] == null)
				{
					HostingHostBuilderExtensions.SetDefaultContentRoot((IConfigurationBuilder)(object)Configuration);
				}
				HostingHostBuilderExtensions.AddDefaultHostConfigurationSources((IConfigurationBuilder)(object)Configuration, settings.Args);
			}
			List<KeyValuePair<string, string>> list = null;
			if (settings.ApplicationName != null)
			{
				if (list == null)
				{
					list = new List<KeyValuePair<string, string>>();
				}
				list.Add(new KeyValuePair<string, string>(HostDefaults.ApplicationKey, settings.ApplicationName));
			}
			if (settings.EnvironmentName != null)
			{
				if (list == null)
				{
					list = new List<KeyValuePair<string, string>>();
				}
				list.Add(new KeyValuePair<string, string>(HostDefaults.EnvironmentKey, settings.EnvironmentName));
			}
			if (settings.ContentRootPath != null)
			{
				if (list == null)
				{
					list = new List<KeyValuePair<string, string>>();
				}
				list.Add(new KeyValuePair<string, string>(HostDefaults.ContentRootKey, settings.ContentRootPath));
			}
			if (list != null)
			{
				MemoryConfigurationBuilderExtensions.AddInMemoryCollection((IConfigurationBuilder)(object)Configuration, (IEnumerable<KeyValuePair<string, string>>)list);
			}
			var (hostingEnvironment, val) = HostBuilder.CreateHostingEnvironment((IConfiguration)(object)Configuration);
			FileConfigurationExtensions.SetFileProvider((IConfigurationBuilder)(object)Configuration, (IFileProvider)(object)val);
			_hostBuilderContext = new HostBuilderContext((IDictionary<object, object>)new Dictionary<object, object>())
			{
				HostingEnvironment = (IHostEnvironment)(object)hostingEnvironment,
				Configuration = (IConfiguration)(object)Configuration
			};
			Environment = (IHostEnvironment)(object)hostingEnvironment;
			HostBuilder.PopulateServiceCollection(Services, _hostBuilderContext, hostingEnvironment, val, (IConfiguration)(object)Configuration, () => _appServices);
			Logging = (ILoggingBuilder)(object)new LoggingBuilder(Services);
			ServiceProviderOptions serviceProviderOptions = null;
			if (!settings.DisableDefaults)
			{
				HostingHostBuilderExtensions.ApplyDefaultAppConfiguration(_hostBuilderContext, (IConfigurationBuilder)(object)Configuration, settings.Args);
				HostingHostBuilderExtensions.AddDefaultServices(_hostBuilderContext, Services);
				serviceProviderOptions = HostingHostBuilderExtensions.CreateDefaultServiceProviderOptions(_hostBuilderContext);
			}
			_createServiceProvider = delegate
			{
				_configureContainer(Services);
				return (IServiceProvider)((serviceProviderOptions != null) ? ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Services, serviceProviderOptions) : ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Services));
			};
		}

		public void ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure = null) where TContainerBuilder : notnull
		{
			IServiceProviderFactory<TContainerBuilder> factory2 = factory;
			Action<TContainerBuilder> configure2 = configure;
			_createServiceProvider = delegate
			{
				TContainerBuilder val = factory2.CreateBuilder(Services);
				_configureContainer(val);
				return factory2.CreateServiceProvider(val);
			};
			_configureContainer = delegate(object containerBuilder)
			{
				configure2?.Invoke((TContainerBuilder)containerBuilder);
			};
		}

		public IHost Build()
		{
			if (_hostBuilt)
			{
				throw new InvalidOperationException(System.SR.BuildCalled);
			}
			_hostBuilt = true;
			DiagnosticListener val = HostBuilder.LogHostBuilding(this);
			try
			{
				_hostBuilderAdapter?.ApplyChanges();
				_appServices = _createServiceProvider();
				_serviceCollection.MakeReadOnly();
				return HostBuilder.ResolveHost(_appServices, val);
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}

		internal IHostBuilder AsHostBuilder()
		{
			return (IHostBuilder)(object)(_hostBuilderAdapter ?? (_hostBuilderAdapter = new HostBuilderAdapter(this)));
		}
	}
	public sealed class HostApplicationBuilderSettings
	{
		public bool DisableDefaults { get; set; }

		public string[]? Args { get; set; }

		public ConfigurationManager? Configuration { get; set; }

		public string? EnvironmentName { get; set; }

		public string? ApplicationName { get; set; }

		public string? ContentRootPath { get; set; }
	}
	public class HostBuilder : IHostBuilder
	{
		private const string HostBuildingDiagnosticListenerName = "Microsoft.Extensions.Hosting";

		private const string HostBuildingEventName = "HostBuilding";

		private const string HostBuiltEventName = "HostBuilt";

		private List<Action<IConfigurationBuilder>> _configureHostConfigActions = new List<Action<IConfigurationBuilder>>();

		private List<Action<HostBuilderContext, IConfigurationBuilder>> _configureAppConfigActions = new List<Action<HostBuilderContext, IConfigurationBuilder>>();

		private List<Action<HostBuilderContext, IServiceCollection>> _configureServicesActions = new List<Action<HostBuilderContext, IServiceCollection>>();

		private List<IConfigureContainerAdapter> _configureContainerActions = new List<IConfigureContainerAdapter>();

		private IServiceFactoryAdapter _serviceProviderFactory;

		private bool _hostBuilt;

		private IConfiguration _hostConfiguration;

		private IConfiguration _appConfiguration;

		private HostBuilderContext _hostBuilderContext;

		private HostingEnvironment _hostingEnvironment;

		private IServiceProvider _appServices;

		private PhysicalFileProvider _defaultProvider;

		public IDictionary<object, object> Properties { get; } = new Dictionary<object, object>();


		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public HostBuilder()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			_serviceProviderFactory = new ServiceFactoryAdapter<IServiceCollection>((IServiceProviderFactory<IServiceCollection>)new DefaultServiceProviderFactory());
		}

		public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate)
		{
			System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
			_configureHostConfigActions.Add(configureDelegate);
			return (IHostBuilder)(object)this;
		}

		public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate)
		{
			System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
			_configureAppConfigActions.Add(configureDelegate);
			return (IHostBuilder)(object)this;
		}

		public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)
		{
			System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
			_configureServicesActions.Add(configureDelegate);
			return (IHostBuilder)(object)this;
		}

		public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull
		{
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			_serviceProviderFactory = new ServiceFactoryAdapter<TContainerBuilder>(factory);
			return (IHostBuilder)(object)this;
		}

		public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
		{
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			_serviceProviderFactory = new ServiceFactoryAdapter<TContainerBuilder>(() => _hostBuilderContext, factory);
			return (IHostBuilder)(object)this;
		}

		public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
		{
			System.ThrowHelper.ThrowIfNull(configureDelegate, "configureDelegate");
			_configureContainerActions.Add(new ConfigureContainerAdapter<TContainerBuilder>(configureDelegate));
			return (IHostBuilder)(object)this;
		}

		public IHost Build()
		{
			if (_hostBuilt)
			{
				throw new InvalidOperationException(System.SR.BuildCalled);
			}
			_hostBuilt = true;
			DiagnosticListener val = LogHostBuilding((IHostBuilder)(object)this);
			try
			{
				InitializeHostConfiguration();
				InitializeHostingEnvironment();
				InitializeHostBuilderContext();
				InitializeAppConfiguration();
				InitializeServiceProvider();
				return ResolveHost(_appServices, val);
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}

		private static DiagnosticListener LogHostBuilding(IHostBuilder hostBuilder)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			DiagnosticListener val = new DiagnosticListener("Microsoft.Extensions.Hosting");
			if (val.IsEnabled() && ((DiagnosticSource)val).IsEnabled("HostBuilding"))
			{
				Write<IHostBuilder>((DiagnosticSource)(object)val, "HostBuilding", hostBuilder);
			}
			return val;
		}

		internal static DiagnosticListener LogHostBuilding(HostApplicationBuilder hostApplicationBuilder)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			DiagnosticListener val = new DiagnosticListener("Microsoft.Extensions.Hosting");
			if (val.IsEnabled() && ((DiagnosticSource)val).IsEnabled("HostBuilding"))
			{
				Write<IHostBuilder>((DiagnosticSource)(object)val, "HostBuilding", hostApplicationBuilder.AsHostBuilder());
			}
			return val;
		}

		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern", Justification = "The values being passed into Write are being consumed by the application already.")]
		private static void Write<T>(DiagnosticSource diagnosticSource, string name, T value)
		{
			diagnosticSource.Write(name, (object)value);
		}

		[MemberNotNull("_hostConfiguration")]
		private void InitializeHostConfiguration()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			IConfigurationBuilder val = MemoryConfigurationBuilderExtensions.AddInMemoryCollection((IConfigurationBuilder)new ConfigurationBuilder());
			foreach (Action<IConfigurationBuilder> configureHostConfigAction in _configureHostConfigActions)
			{
				configureHostConfigAction(val);
			}
			_hostConfiguration = (IConfiguration)(object)val.Build();
		}

		[MemberNotNull("_defaultProvider")]
		[MemberNotNull("_hostingEnvironment")]
		private void InitializeHostingEnvironment()
		{
			(_hostingEnvironment, _defaultProvider) = CreateHostingEnvironment(_hostConfiguration);
		}

		internal static (HostingEnvironment, PhysicalFileProvider) CreateHostingEnvironment(IConfiguration hostConfiguration)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			HostingEnvironment hostingEnvironment = new HostingEnvironment
			{
				EnvironmentName = (hostConfiguration[HostDefaults.EnvironmentKey] ?? Environments.Production),
				ContentRootPath = ResolveContentRootPath(hostConfiguration[HostDefaults.ContentRootKey], AppContext.BaseDirectory)
			};
			string text = hostConfiguration[HostDefaults.ApplicationKey];
			if (string.IsNullOrEmpty(text))
			{
				text = Assembly.GetEntryAssembly()?.GetName().Name;
			}
			if (text != null)
			{
				hostingEnvironment.ApplicationName = text;
			}
			PhysicalFileProvider item = (PhysicalFileProvider)(object)(hostingEnvironment.ContentRootFileProvider = (IFileProvider)new PhysicalFileProvider(hostingEnvironment.ContentRootPath));
			return (hostingEnvironment, item);
		}

		internal static string ResolveContentRootPath(string contentRootPath, string basePath)
		{
			if (string.IsNullOrEmpty(contentRootPath))
			{
				return basePath;
			}
			if (Path.IsPathRooted(contentRootPath))
			{
				return contentRootPath;
			}
			return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
		}

		[MemberNotNull("_hostBuilderContext")]
		private void InitializeHostBuilderContext()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			_hostBuilderContext = new HostBuilderContext(Properties)
			{
				HostingEnvironment = (IHostEnvironment)(object)_hostingEnvironment,
				Configuration = _hostConfiguration
			};
		}

		[MemberNotNull("_appConfiguration")]
		private void InitializeAppConfiguration()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			IConfigurationBuilder val = ChainedBuilderExtensions.AddConfiguration(FileConfigurationExtensions.SetBasePath((IConfigurationBuilder)new ConfigurationBuilder(), _hostingEnvironment.ContentRootPath), _hostConfiguration, true);
			foreach (Action<HostBuilderContext, IConfigurationBuilder> configureAppConfigAction in _configureAppConfigActions)
			{
				configureAppConfigAction(_hostBuilderContext, val);
			}
			_appConfiguration = (IConfiguration)(object)val.Build();
			_hostBuilderContext.Configuration = _appConfiguration;
		}

		[MemberNotNull("_appServices")]
		internal static void PopulateServiceCollection(IServiceCollection services, HostBuilderContext hostBuilderContext, HostingEnvironment hostingEnvironment, PhysicalFileProvider defaultFileProvider, IConfiguration appConfiguration, Func<IServiceProvider> serviceProviderGetter)
		{
			ServiceCollectionServiceExtensions.AddSingleton<IHostingEnvironment>(services, (IHostingEnvironment)(object)hostingEnvironment);
			ServiceCollectionServiceExtensions.AddSingleton<IHostEnvironment>(services, (IHostEnvironment)(object)hostingEnvironment);
			ServiceCollectionServiceExtensions.AddSingleton<HostBuilderContext>(services, hostBuilderContext);
			ServiceCollectionServiceExtensions.AddSingleton<IConfiguration>(services, (Func<IServiceProvider, IConfiguration>)((IServiceProvider _) => appConfiguration));
			ServiceCollectionServiceExtensions.AddSingleton<IApplicationLifetime>(services, (Func<IServiceProvider, IApplicationLifetime>)((IServiceProvider s) => (IApplicationLifetime)ServiceProviderServiceExtensions.GetRequiredService<IHostApplicationLifetime>(s)));
			ServiceCollectionServiceExtensions.AddSingleton<IHostApplicationLifetime, ApplicationLifetime>(services);
			AddLifetime(services);
			ServiceCollectionServiceExtensions.AddSingleton<IHost>(services, (Func<IServiceProvider, IHost>)delegate
			{
				IServiceProvider serviceProvider = serviceProviderGetter();
				return (IHost)(object)new Microsoft.Extensions.Hosting.Internal.Host(serviceProvider, (IHostEnvironment)(object)hostingEnvironment, defaultFileProvider, ServiceProviderServiceExtensions.GetRequiredService<IHostApplicationLifetime>(serviceProvider), ServiceProviderServiceExtensions.GetRequiredService<ILogger<Microsoft.Extensions.Hosting.Internal.Host>>(serviceProvider), ServiceProviderServiceExtensions.GetRequiredService<IHostLifetime>(serviceProvider), ServiceProviderServiceExtensions.GetRequiredService<IOptions<HostOptions>>(serviceProvider));
			});
			OptionsServiceCollectionExtensions.Configure<HostOptions>(OptionsServiceCollectionExtensions.AddOptions(services), (Action<HostOptions>)delegate(HostOptions options)
			{
				options.Initialize(hostBuilderContext.Configuration);
			});
			LoggingServiceCollectionExtensions.AddLogging(services);
		}

		[MemberNotNull("_appServices")]
		private void InitializeServiceProvider()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			ServiceCollection val = new ServiceCollection();
			PopulateServiceCollection((IServiceCollection)(object)val, _hostBuilderContext, _hostingEnvironment, _defaultProvider, _appConfiguration, () => _appServices);
			foreach (Action<HostBuilderContext, IServiceCollection> configureServicesAction in _configureServicesActions)
			{
				configureServicesAction(_hostBuilderContext, (IServiceCollection)(object)val);
			}
			object containerBuilder = _serviceProviderFactory.CreateBuilder((IServiceCollection)(object)val);
			foreach (IConfigureContainerAdapter configureContainerAction in _configureContainerActions)
			{
				configureContainerAction.ConfigureContainer(_hostBuilderContext, containerBuilder);
			}
			_appServices = _serviceProviderFactory.CreateServiceProvider(containerBuilder);
		}

		internal static IHost ResolveHost(IServiceProvider serviceProvider, DiagnosticListener diagnosticListener)
		{
			if (serviceProvider == null)
			{
				throw new InvalidOperationException(System.SR.NullIServiceProvider);
			}
			ServiceProviderServiceExtensions.GetService<IConfiguration>(serviceProvider);
			IHost requiredService = ServiceProviderServiceExtensions.GetRequiredService<IHost>(serviceProvider);
			if (diagnosticListener.IsEnabled() && ((DiagnosticSource)diagnosticListener).IsEnabled("HostBuilt"))
			{
				Write<IHost>((DiagnosticSource)(object)diagnosticListener, "HostBuilt", requiredService);
			}
			return requiredService;
		}

		private static void AddLifetime(IServiceCollection services)
		{
			ServiceCollectionServiceExtensions.AddSingleton<IHostLifetime, ConsoleLifetime>(services);
		}
	}
	public static class HostingHostBuilderExtensions
	{
		public static IHostBuilder UseEnvironment(this IHostBuilder hostBuilder, string environment)
		{
			string environment2 = environment;
			return hostBuilder.ConfigureHostConfiguration((Action<IConfigurationBuilder>)delegate(IConfigurationBuilder configBuilder)
			{
				System.ThrowHelper.ThrowIfNull(environment2, "environment");
				MemoryConfigurationBuilderExtensions.AddInMemoryCollection(configBuilder, (IEnumerable<KeyValuePair<string, string>>)new KeyValuePair<string, string>[1]
				{
					new KeyValuePair<string, string>(HostDefaults.EnvironmentKey, environment2)
				});
			});
		}

		public static IHostBuilder UseContentRoot(this IHostBuilder hostBuilder, string contentRoot)
		{
			string contentRoot2 = contentRoot;
			return hostBuilder.ConfigureHostConfiguration((Action<IConfigurationBuilder>)delegate(IConfigurationBuilder configBuilder)
			{
				System.ThrowHelper.ThrowIfNull(contentRoot2, "contentRoot");
				MemoryConfigurationBuilderExtensions.AddInMemoryCollection(configBuilder, (IEnumerable<KeyValuePair<string, string>>)new KeyValuePair<string, string>[1]
				{
					new KeyValuePair<string, string>(HostDefaults.ContentRootKey, contentRoot2)
				});
			});
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static IHostBuilder UseDefaultServiceProvider(this IHostBuilder hostBuilder, Action<ServiceProviderOptions> configure)
		{
			Action<ServiceProviderOptions> configure2 = configure;
			return hostBuilder.UseDefaultServiceProvider(delegate(HostBuilderContext context, ServiceProviderOptions options)
			{
				configure2(options);
			});
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static IHostBuilder UseDefaultServiceProvider(this IHostBuilder hostBuilder, Action<HostBuilderContext, ServiceProviderOptions> configure)
		{
			Action<HostBuilderContext, ServiceProviderOptions> configure2 = configure;
			return hostBuilder.UseServiceProviderFactory<IServiceCollection>((Func<HostBuilderContext, IServiceProviderFactory<IServiceCollection>>)delegate(HostBuilderContext context)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				ServiceProviderOptions val = new ServiceProviderOptions();
				configure2(context, val);
				return (IServiceProviderFactory<IServiceCollection>)new DefaultServiceProviderFactory(val);
			});
		}

		public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action<HostBuilderContext, ILoggingBuilder> configureLogging)
		{
			Action<HostBuilderContext, ILoggingBuilder> configureLogging2 = configureLogging;
			return hostBuilder.ConfigureServices((Action<HostBuilderContext, IServiceCollection>)delegate(HostBuilderContext context, IServiceCollection collection)
			{
				LoggingServiceCollectionExtensions.AddLogging(collection, (Action<ILoggingBuilder>)delegate(ILoggingBuilder builder)
				{
					configureLogging2(context, builder);
				});
			});
		}

		public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action<ILoggingBuilder> configureLogging)
		{
			Action<ILoggingBuilder> configureLogging2 = configureLogging;
			return hostBuilder.ConfigureServices((Action<HostBuilderContext, IServiceCollection>)delegate(HostBuilderContext context, IServiceCollection collection)
			{
				LoggingServiceCollectionExtensions.AddLogging(collection, (Action<ILoggingBuilder>)delegate(ILoggingBuilder builder)
				{
					configureLogging2(builder);
				});
			});
		}

		public static IHostBuilder ConfigureHostOptions(this IHostBuilder hostBuilder, Action<HostBuilderContext, HostOptions> configureOptions)
		{
			Action<HostBuilderContext, HostOptions> configureOptions2 = configureOptions;
			return hostBuilder.ConfigureServices((Action<HostBuilderContext, IServiceCollection>)delegate(HostBuilderContext context, IServiceCollection collection)
			{
				OptionsServiceCollectionExtensions.Configure<HostOptions>(collection, (Action<HostOptions>)delegate(HostOptions options)
				{
					configureOptions2(context, options);
				});
			});
		}

		public static IHostBuilder ConfigureHostOptions(this IHostBuilder hostBuilder, Action<HostOptions> configureOptions)
		{
			Action<HostOptions> configureOptions2 = configureOptions;
			return hostBuilder.ConfigureServices(delegate(IServiceCollection collection)
			{
				OptionsServiceCollectionExtensions.Configure<HostOptions>(collection, configureOptions2);
			});
		}

		public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder hostBuilder, Action<IConfigurationBuilder> configureDelegate)
		{
			Action<IConfigurationBuilder> configureDelegate2 = configureDelegate;
			return hostBuilder.ConfigureAppConfiguration((Action<HostBuilderContext, IConfigurationBuilder>)delegate(HostBuilderContext context, IConfigurationBuilder builder)
			{
				configureDelegate2(builder);
			});
		}

		public static IHostBuilder ConfigureServices(this IHostBuilder hostBuilder, Action<IServiceCollection> configureDelegate)
		{
			Action<IServiceCollection> configureDelegate2 = configureDelegate;
			return hostBuilder.ConfigureServices((Action<HostBuilderContext, IServiceCollection>)delegate(HostBuilderContext context, IServiceCollection collection)
			{
				configureDelegate2(collection);
			});
		}

		public static IHostBuilder ConfigureContainer<TContainerBuilder>(this IHostBuilder hostBuilder, Action<TContainerBuilder> configureDelegate)
		{
			Action<TContainerBuilder> configureDelegate2 = configureDelegate;
			return hostBuilder.ConfigureContainer<TContainerBuilder>((Action<HostBuilderContext, TContainerBuilder>)delegate(HostBuilderContext context, TContainerBuilder builder)
			{
				configureDelegate2(builder);
			});
		}

		[RequiresDynamicCode("Hosting uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.")]
		public static IHostBuilder ConfigureDefaults(this IHostBuilder builder, string[]? args)
		{
			string[] args2 = args;
			return builder.ConfigureHostConfiguration((Action<IConfigurationBuilder>)delegate(IConfigurationBuilder config)
			{
				ApplyDefaultHostConfiguration(config, args2);
			}).ConfigureAppConfiguration((Action<HostBuilderContext, IConfigurationBuilder>)delegate(HostBuilderContext hostingContext, IConfigurationBuilder config)
			{
				ApplyDefaultAppConfiguration(hostingContext, config, args2);
			}).ConfigureServices((Action<HostBuilderContext, IServiceCollection>)AddDefaultServices)
				.UseServiceProviderFactory<IServiceCollection>((Func<HostBuilderContext, IServiceProviderFactory<IServiceCollection>>)((HostBuilderContext context) => (IServiceProviderFactory<IServiceCollection>)new DefaultServiceProviderFactory(CreateDefaultServiceProviderOptions(context))));
		}

		private static void ApplyDefaultHostConfiguration(IConfigurationBuilder hostConfigBuilder, string[] args)
		{
			SetDefaultContentRoot(hostConfigBuilder);
			AddDefaultHostConfigurationSources(hostConfigBuilder, args);
		}

		internal static void SetDefaultContentRoot(IConfigurationBuilder hostConfigBuilder)
		{
			string currentDirectory = Environment.CurrentDirectory;
			if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || !string.Equals(currentDirectory, Environment.GetFolderPath(Environment.SpecialFolder.System), StringComparison.OrdinalIgnoreCase))
			{
				MemoryConfigurationBuilderExtensions.AddInMemoryCollection(hostConfigBuilder, (IEnumerable<KeyValuePair<string, string>>)new KeyValuePair<string, string>[1]
				{
					new KeyValuePair<string, string>(HostDefaults.ContentRootKey, currentDirectory)
				});
			}
		}

		internal static void AddDefaultHostConfigurationSources(IConfigurationBuilder hostConfigBuilder, string[] args)
		{
			EnvironmentVariablesExtensions.AddEnvironmentVariables(hostConfigBuilder, "DOTNET_");
			if (args != null && args.Length > 0)
			{
				CommandLineConfigurationExtensions.AddCommandLine(hostConfigBuilder, args);
			}
		}

		internal static void ApplyDefaultAppConfiguration(HostBuilderContext hostingContext, IConfigurationBuilder appConfigBuilder, string[] args)
		{
			IHostEnvironment hostingEnvironment = hostingContext.HostingEnvironment;
			bool flag = GetReloadConfigOnChangeValue(hostingContext);
			JsonConfigurationExtensions.AddJsonFile(JsonConfigurationExtensions.AddJsonFile(appConfigBuilder, "appsettings.json", true, flag), "appsettings." + hostingEnvironment.EnvironmentName + ".json", true, flag);
			if (HostEnvironmentEnvExtensions.IsDevelopment(hostingEnvironment))
			{
				string applicationName = hostingEnvironment.ApplicationName;
				if (applicationName != null && applicationName.Length > 0)
				{
					Assembly assembly = Assembly.Load(new AssemblyName(hostingEnvironment.ApplicationName));
					if ((object)assembly != null)
					{
						UserSecretsConfigurationExtensions.AddUserSecrets(appConfigBuilder, assembly, true, flag);
					}
				}
			}
			EnvironmentVariablesExtensions.AddEnvironmentVariables(appConfigBuilder);
			if (args != null && args.Length > 0)
			{
				CommandLineConfigurationExtensions.AddCommandLine(appConfigBuilder, args);
			}
			[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "Calling IConfiguration.GetValue is safe when the T is bool.")]
			static bool GetReloadConfigOnChangeValue(HostBuilderContext hostingContext)
			{
				return ConfigurationBinder.GetValue<bool>(hostingContext.Configuration, "hostBuilder:reloadConfigOnChange", true);
			}
		}

		internal static void AddDefaultServices(HostBuilderContext hostingContext, IServiceCollection services)
		{
			LoggingServiceCollectionExtensions.AddLogging(services, (Action<ILoggingBuilder>)delegate(ILoggingBuilder logging)
			{
				bool flag = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
				if (flag)
				{
					FilterLoggingBuilderExtensions.AddFilter<EventLogLoggerProvider>(logging, (Func<LogLevel, bool>)((LogLevel level) => (int)level >= 3));
				}
				LoggingBuilderExtensions.AddConfiguration(logging, (IConfiguration)(object)hostingContext.Configuration.GetSection("Logging"));
				ConsoleLoggerExtensions.AddConsole(logging);
				DebugLoggerFactoryExtensions.AddDebug(logging);
				EventSourceLoggerFactoryExtensions.AddEventSourceLogger(logging);
				if (flag)
				{
					EventLoggerFactoryExtensions.AddEventLog(logging);
				}
				LoggingBuilderExtensions.Configure(logging, (Action<LoggerFactoryOptions>)delegate(LoggerFactoryOptions options)
				{
					options.ActivityTrackingOptions = (ActivityTrackingOptions)7;
				});
			});
		}

		internal static ServiceProviderOptions CreateDefaultServiceProviderOptions(HostBuilderContext context)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			bool flag = HostEnvironmentEnvExtensions.IsDevelopment(context.HostingEnvironment);
			return new ServiceProviderOptions
			{
				ValidateScopes = flag,
				ValidateOnBuild = flag
			};
		}

		[UnsupportedOSPlatform("android")]
		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder)
		{
			return hostBuilder.ConfigureServices(delegate(IServiceCollection collection)
			{
				ServiceCollectionServiceExtensions.AddSingleton<IHostLifetime, ConsoleLifetime>(collection);
			});
		}

		[UnsupportedOSPlatform("android")]
		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions)
		{
			Action<ConsoleLifetimeOptions> configureOptions2 = configureOptions;
			return hostBuilder.ConfigureServices(delegate(IServiceCollection collection)
			{
				ServiceCollectionServiceExtensions.AddSingleton<IHostLifetime, ConsoleLifetime>(collection);
				OptionsServiceCollectionExtensions.Configure<ConsoleLifetimeOptions>(collection, configureOptions2);
			});
		}

		[UnsupportedOSPlatform("android")]
		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default(CancellationToken))
		{
			return HostingAbstractionsHostExtensions.RunAsync(hostBuilder.UseConsoleLifetime().Build(), cancellationToken);
		}

		[UnsupportedOSPlatform("android")]
		[UnsupportedOSPlatform("browser")]
		[UnsupportedOSPlatform("ios")]
		[UnsupportedOSPlatform("tvos")]
		public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions, CancellationToken cancellationToken = default(CancellationToken))
		{
			return HostingAbstractionsHostExtensions.RunAsync(hostBuilder.UseConsoleLifetime(configureOptions).Build(), cancellationToken);
		}
	}
	public class HostOptions
	{
		public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(30.0);


		public BackgroundServiceExceptionBehavior BackgroundServiceExceptionBehavior { get; set; }

		internal void Initialize(IConfiguration configuration)
		{
			string text = configuration["shutdownTimeoutSeconds"];
			if (!string.IsNullOrEmpty(text) && int.TryParse(text, NumberStyles.None, CultureInfo.InvariantCulture, out var result))
			{
				ShutdownTimeout = TimeSpan.FromSeconds(result);
			}
		}
	}
}
namespace Microsoft.Extensions.Hosting.Internal
{
	public class ApplicationLifetime : IApplicationLifetime, IHostApplicationLifetime
	{
		private readonly CancellationTokenSource _startedSource = new CancellationTokenSource();

		private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource();

		private readonly CancellationTokenSource _stoppedSource = new CancellationTokenSource();

		private readonly ILogger<ApplicationLifetime> _logger;

		public CancellationToken ApplicationStarted => _startedSource.Token;

		public CancellationToken ApplicationStopping => _stoppingSource.Token;

		public CancellationToken ApplicationStopped => _stoppedSource.Token;

		public ApplicationLifetime(ILogger<ApplicationLifetime> logger)
		{
			_logger = logger;
		}

		public void StopApplication()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			lock (_stoppingSource)
			{
				try
				{
					ExecuteHandlers(_stoppingSource);
				}
				catch (Exception exception)
				{
					((ILogger)(object)_logger).ApplicationError(LoggerEventIds.ApplicationStoppingException, "An error occurred stopping the application", exception);
				}
			}
		}

		public void NotifyStarted()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				ExecuteHandlers(_startedSource);
			}
			catch (Exception exception)
			{
				((ILogger)(object)_logger).ApplicationError(LoggerEventIds.ApplicationStartupException, "An error occurred starting the application", exception);
			}
		}

		public void NotifyStopped()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				ExecuteHandlers(_stoppedSource);
			}
			catch (Exception exception)
			{
				((ILogger)(object)_logger).ApplicationError(LoggerEventIds.ApplicationStoppedException, "An error occurred stopping the application", exception);
			}
		}

		private static void ExecuteHandlers(CancellationTokenSource cancel)
		{
			if (!cancel.IsCancellationRequested)
			{
				cancel.Cancel(throwOnFirstException: false);
			}
		}
	}
	internal sealed class ConfigureContainerAdapter<TContainerBuilder> : IConfigureContainerAdapter
	{
		private Action<HostBuilderContext, TContainerBuilder> _action;

		public ConfigureContainerAdapter(Action<HostBuilderContext, TContainerBuilder> action)
		{
			System.ThrowHelper.ThrowIfNull(action, "action");
			_action = action;
		}

		public void ConfigureContainer(HostBuilderContext hostContext, object containerBuilder)
		{
			_action(hostContext, (TContainerBuilder)containerBuilder);
		}
	}
	[UnsupportedOSPlatform("android")]
	[UnsupportedOSPlatform("browser")]
	[UnsupportedOSPlatform("ios")]
	[UnsupportedOSPlatform("tvos")]
	public class ConsoleLifetime : IHostLifetime, IDisposable
	{
		private CancellationTokenRegistration _applicationStartedRegistration;

		private CancellationTokenRegistration _applicationStoppingRegistration;

		private readonly ManualResetEvent _shutdownBlock = new ManualResetEvent(initialState: false);

		private ConsoleLifetimeOptions Options { get; }

		private IHostEnvironment Environment { get; }

		private IHostApplicationLifetime ApplicationLifetime { get; }

		private HostOptions HostOptions { get; }

		private ILogger Logger { get; }

		public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions)
			: this(options, environment, applicationLifetime, hostOptions, (ILoggerFactory)(object)NullLoggerFactory.Instance)
		{
		}

		public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions, ILoggerFactory loggerFactory)
		{
			System.ThrowHelper.ThrowIfNull(options?.Value, "options");
			System.ThrowHelper.ThrowIfNull(applicationLifetime, "applicationLifetime");
			System.ThrowHelper.ThrowIfNull(environment, "environment");
			System.ThrowHelper.ThrowIfNull(hostOptions?.Value, "hostOptions");
			Options = options.Value;
			Environment = environment;
			ApplicationLifetime = applicationLifetime;
			HostOptions = hostOptions.Value;
			Logger = loggerFactory.CreateLogger("Microsoft.Hosting.Lifetime");
		}

		public Task WaitForStartAsync(CancellationToken cancellationToken)
		{
			if (!Options.SuppressStatusMessages)
			{
				_applicationStartedRegistration = ApplicationLifetime.ApplicationStarted.Register(delegate(object state)
				{
					((ConsoleLifetime)state).OnApplicationStarted();
				}, this);
				_applicationStoppingRegistration = ApplicationLifetime.ApplicationStopping.Register(delegate(object state)
				{
					((ConsoleLifetime)state).OnApplicationStopping();
				}, this);
			}
			RegisterShutdownHandlers();
			return Task.CompletedTask;
		}

		private void RegisterShutdownHandlers()
		{
			AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
			Console.CancelKeyPress += OnCancelKeyPress;
		}

		private void OnApplicationStarted()
		{
			LoggerExtensions.LogInformation(Logger, "Application started. Press Ctrl+C to shut down.", Array.Empty<object>());
			LoggerExtensions.LogInformation(Logger, "Hosting environment: {EnvName}", new object[1] { Environment.EnvironmentName });
			LoggerExtensions.LogInformation(Logger, "Content root path: {ContentRoot}", new object[1] { Environment.ContentRootPath });
		}

		private void OnApplicationStopping()
		{
			LoggerExtensions.LogInformation(Logger, "Application is shutting down...", Array.Empty<object>());
		}

		public Task StopAsync(CancellationToken cancellationToken)
		{
			return Task.CompletedTask;
		}

		public void Dispose()
		{
			UnregisterShutdownHandlers();
			_applicationStartedRegistration.Dispose();
			_applicationStoppingRegistration.Dispose();
		}

		private void UnregisterShutdownHandlers()
		{
			_shutdownBlock.Set();
			AppDomain.CurrentDomain.ProcessExit -= OnProcessExit;
			Console.CancelKeyPress -= OnCancelKeyPress;
		}

		private void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
		{
			e.Cancel = true;
			ApplicationLifetime.StopApplication();
			_shutdownBlock.Set();
		}

		private void OnProcessExit(object sender, EventArgs e)
		{
			ApplicationLifetime.StopApplication();
			if (!_shutdownBlock.WaitOne(HostOptions.ShutdownTimeout))
			{
				LoggerExtensions.LogInformation(Logger, "Waiting for the host to be disposed. Ensure all 'IHost' instances are wrapped in 'using' blocks.", Array.Empty<object>());
			}
			_shutdownBlock.WaitOne(HostOptions.ShutdownTimeout);
			System.Environment.ExitCode = 0;
		}
	}
	internal sealed class Host : IHost, IDisposable, IAsyncDisposable
	{
		private readonly ILogger<Host> _logger;

		private readonly IHostLifetime _hostLifetime;

		private readonly ApplicationLifetime _applicationLifetime;

		private readonly HostOptions _options;

		private readonly IHostEnvironment _hostEnvironment;

		private readonly PhysicalFileProvider _defaultProvider;

		private IEnumerable<IHostedService> _hostedServices;

		private volatile bool _stopCalled;

		public IServiceProvider Services { get; }

		public Host(IServiceProvider services, IHostEnvironment hostEnvironment, PhysicalFileProvider defaultProvider, IHostApplicationLifetime applicationLifetime, ILogger<Host> logger, IHostLifetime hostLifetime, IOptions<HostOptions> options)
		{
			System.ThrowHelper.ThrowIfNull(services, "services");
			System.ThrowHelper.ThrowIfNull(applicationLifetime, "applicationLifetime");
			System.ThrowHelper.ThrowIfNull(logger, "logger");
			System.ThrowHelper.ThrowIfNull(hostLifetime, "hostLifetime");
			Services = services;
			_applicationLifetime = applicationLifetime as ApplicationLifetime;
			_hostEnvironment = hostEnvironment;
			_defaultProvider = defaultProvider;
			if (_applicationLifetime == null)
			{
				throw new ArgumentException(System.SR.IHostApplicationLifetimeReplacementNotSupported, "applicationLifetime");
			}
			_logger = logger;
			_hostLifetime = hostLifetime;
			_options = options?.Value ?? throw new ArgumentNullException("options");
		}

		public async Task StartAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			((ILogger)(object)_logger).Starting();
			using CancellationTokenSource combinedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, _applicationLifetime.ApplicationStopping);
			CancellationToken combinedCancellationToken = combinedCancellationTokenSource.Token;
			await _hostLifetime.WaitForStartAsync(combinedCancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			combinedCancellationToken.ThrowIfCancellationRequested();
			_hostedServices = ServiceProviderServiceExtensions.GetRequiredService<IEnumerable<IHostedService>>(Services);
			foreach (IHostedService hostedService in _hostedServices)
			{
				await hostedService.StartAsync(combinedCancellationToken).ConfigureAwait(continueOnCapturedContext: false);
				BackgroundService val = (BackgroundService)(object)((hostedService is BackgroundService) ? hostedService : null);
				if (val != null)
				{
					TryExecuteBackgroundServiceAsync(val);
				}
			}
			_applicationLifetime.NotifyStarted();
			((ILogger)(object)_logger).Started();
		}

		private async Task TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
		{
			Task backgroundTask = backgroundService.ExecuteTask;
			if (backgroundTask == null)
			{
				return;
			}
			try
			{
				await backgroundTask.ConfigureAwait(continueOnCapturedContext: false);
			}
			catch (Exception ex)
			{
				if (!_stopCalled || !backgroundTask.IsCanceled || !(ex is OperationCanceledException))
				{
					((ILogger)(object)_logger).BackgroundServiceFaulted(ex);
					if (_options.BackgroundServiceExceptionBehavior == BackgroundServiceExceptionBehavior.StopHost)
					{
						((ILogger)(object)_logger).BackgroundServiceStoppingHost(ex);
						_applicationLifetime.StopApplication();
					}
				}
			}
		}

		public async Task StopAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			_stopCalled = true;
			((ILogger)(object)_logger).Stopping();
			using (CancellationTokenSource cts = new CancellationTokenSource(_options.ShutdownTimeout))
			{
				using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cts.Token, cancellationToken);
				CancellationToken token = linkedCts.Token;
				_applicationLifetime.StopApplication();
				IList<Exception> exceptions = new List<Exception>();
				if (_hostedServices != null)
				{
					foreach (IHostedService item3 in _hostedServices.Reverse())
					{
						try
						{
							await item3.StopAsync(token).ConfigureAwait(continueOnCapturedContext: false);
						}
						catch (Exception item)
						{
							exceptions.Add(item);
						}
					}
				}
				_applicationLifetime.NotifyStopped();
				try
				{
					await _hostLifetime.StopAsync(token).ConfigureAwait(continueOnCapturedContext: false);
				}
				catch (Exception item2)
				{
					exceptions.Add(item2);
				}
				if (exceptions.Count > 0)
				{
					AggregateException ex = new AggregateException("One or more hosted services failed to stop.", exceptions);
					((ILogger)(object)_logger).StoppedWithException(ex);
					throw ex;
				}
			}
			((ILogger)(object)_logger).Stopped();
		}

		public void Dispose()
		{
			DisposeAsync().AsTask().GetAwaiter().GetResult();
		}

		public async ValueTask DisposeAsync()
		{
			if (_hostEnvironment.ContentRootFileProvider != _defaultProvider)
			{
				await DisposeAsync(_hostEnvironment.ContentRootFileProvider).ConfigureAwait(continueOnCapturedContext: false);
				await DisposeAsync(_defaultProvider).ConfigureAwait(continueOnCapturedContext: false);
			}
			else
			{
				await DisposeAsync(_hostEnvironment.ContentRootFileProvider).ConfigureAwait(continueOnCapturedContext: false);
			}
			await DisposeAsync(Services).ConfigureAwait(continueOnCapturedContext: false);
			static async ValueTask DisposeAsync(object o)
			{
				if (!(o is IAsyncDisposable asyncDisposable))
				{
					if (o is IDisposable disposable)
					{
						disposable.Dispose();
					}
				}
				else
				{
					await asyncDisposable.DisposeAsync().ConfigureAwait(continueOnCapturedContext: false);
				}
			}
		}
	}
	public class HostingEnvironment : IHostingEnvironment, IHostEnvironment
	{
		public string EnvironmentName { get; set; } = string.Empty;


		public string ApplicationName { get; set; } = string.Empty;


		public string ContentRootPath { get; set; } = string.Empty;


		public IFileProvider ContentRootFileProvider { get; set; }
	}
	internal static class HostingLoggerExtensions
	{
		public static void ApplicationError(this ILogger logger, EventId eventId, string message, Exception exception)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (exception is ReflectionTypeLoadException ex)
			{
				Exception[] loaderExceptions = ex.LoaderExceptions;
				foreach (Exception ex2 in loaderExceptions)
				{
					if (ex2 != null)
					{
						message = message + Environment.NewLine + ex2.Message;
					}
				}
			}
			string text = message;
			LoggerExtensions.LogCritical(logger, eventId, exception, text, Array.Empty<object>());
		}

		public static void Starting(this ILogger logger)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)1))
			{
				LoggerExtensions.LogDebug(logger, LoggerEventIds.Starting, "Hosting starting", Array.Empty<object>());
			}
		}

		public static void Started(this ILogger logger)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)1))
			{
				LoggerExtensions.LogDebug(logger, LoggerEventIds.Started, "Hosting started", Array.Empty<object>());
			}
		}

		public static void Stopping(this ILogger logger)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)1))
			{
				LoggerExtensions.LogDebug(logger, LoggerEventIds.Stopping, "Hosting stopping", Array.Empty<object>());
			}
		}

		public static void Stopped(this ILogger logger)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)1))
			{
				LoggerExtensions.LogDebug(logger, LoggerEventIds.Stopped, "Hosting stopped", Array.Empty<object>());
			}
		}

		public static void StoppedWithException(this ILogger logger, Exception ex)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)1))
			{
				LoggerExtensions.LogDebug(logger, LoggerEventIds.StoppedWithException, ex, "Hosting shutdown exception", Array.Empty<object>());
			}
		}

		public static void BackgroundServiceFaulted(this ILogger logger, Exception ex)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)4))
			{
				LoggerExtensions.LogError(logger, LoggerEventIds.BackgroundServiceFaulted, ex, "BackgroundService failed", Array.Empty<object>());
			}
		}

		public static void BackgroundServiceStoppingHost(this ILogger logger, Exception ex)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (logger.IsEnabled((LogLevel)5))
			{
				LoggerExtensions.LogCritical(logger, LoggerEventIds.BackgroundServiceStoppingHost, ex, System.SR.BackgroundServiceExceptionStoppedHost, Array.Empty<object>());
			}
		}
	}
	internal interface IConfigureContainerAdapter
	{
		void ConfigureContainer(HostBuilderContext hostContext, object containerBuilder);
	}
	internal interface IServiceFactoryAdapter
	{
		object CreateBuilder(IServiceCollection services);

		IServiceProvider CreateServiceProvider(object containerBuilder);
	}
	internal static class LoggerEventIds
	{
		public static readonly EventId Starting = new EventId(1, "Starting");

		public static readonly EventId Started = new EventId(2, "Started");

		public static readonly EventId Stopping = new EventId(3, "Stopping");

		public static readonly EventId Stopped = new EventId(4, "Stopped");

		public static readonly EventId StoppedWithException = new EventId(5, "StoppedWithException");

		public static readonly EventId ApplicationStartupException = new EventId(6, "ApplicationStartupException");

		public static readonly EventId ApplicationStoppingException = new EventId(7, "ApplicationStoppingException");

		public static readonly EventId ApplicationStoppedException = new EventId(8, "ApplicationStoppedException");

		public static readonly EventId BackgroundServiceFaulted = new EventId(9, "BackgroundServiceFaulted");

		public static readonly EventId BackgroundServiceStoppingHost = new EventId(10, "BackgroundServiceStoppingHost");
	}
	internal sealed class NullLifetime : IHostLifetime
	{
		public Task WaitForStartAsync(CancellationToken cancellationToken)
		{
			return Task.CompletedTask;
		}

		public Task StopAsync(CancellationToken cancellationToken)
		{
			return Task.CompletedTask;
		}
	}
	internal sealed class ServiceFactoryAdapter<TContainerBuilder> : IServiceFactoryAdapter
	{
		private IServiceProviderFactory<TContainerBuilder> _serviceProviderFactory;

		private readonly Func<HostBuilderContext> _contextResolver;

		private Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> _factoryResolver;

		public ServiceFactoryAdapter(IServiceProviderFactory<TContainerBuilder> serviceProviderFactory)
		{
			System.ThrowHelper.ThrowIfNull(serviceProviderFactory, "serviceProviderFactory");
			_serviceProviderFactory = serviceProviderFactory;
		}

		public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)
		{
			System.ThrowHelper.ThrowIfNull(contextResolver, "contextResolver");
			System.ThrowHelper.ThrowIfNull(factoryResolver, "factoryResolver");
			_contextResolver = contextResolver;
			_factoryResolver = factoryResolver;
		}

		public object CreateBuilder(IServiceCollection services)
		{
			if (_serviceProviderFactory == null)
			{
				_serviceProviderFactory = _factoryResolver(_contextResolver());
				if (_serviceProviderFactory == null)
				{
					throw new InvalidOperationException(System.SR.ResolverReturnedNull);
				}
			}
			return _serviceProviderFactory.CreateBuilder(services);
		}

		public IServiceProvider CreateServiceProvider(object containerBuilder)
		{
			if (_serviceProviderFactory == null)
			{
				throw new InvalidOperationException(System.SR.CreateBuilderCallBeforeCreateServiceProvider);
			}
			return _serviceProviderFactory.CreateServiceProvider((TContainerBuilder)containerBuilder);
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Logging.Abstractions.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using FxResources.Microsoft.Extensions.Logging.Abstractions;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Internal;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Logging.Abstractions")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Logging abstractions for Microsoft.Extensions.Logging.\r\n\r\nCommonly Used Types:\r\nMicrosoft.Extensions.Logging.ILogger\r\nMicrosoft.Extensions.Logging.ILoggerFactory\r\nMicrosoft.Extensions.Logging.ILogger<TCategoryName>\r\nMicrosoft.Extensions.Logging.LogLevel\r\nMicrosoft.Extensions.Logging.Logger<T>\r\nMicrosoft.Extensions.Logging.LoggerMessage\r\nMicrosoft.Extensions.Logging.Abstractions.NullLogger")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("7.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsByRefLikeAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Logging.Abstractions
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string UnexpectedNumberOfNamedParameters => GetResourceString("UnexpectedNumberOfNamedParameters");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace System.Text
{
	internal ref struct ValueStringBuilder
	{
		private char[] _arrayToReturnToPool;

		private Span<char> _chars;

		private int _pos;

		public int Length
		{
			get
			{
				return _pos;
			}
			set
			{
				_pos = value;
			}
		}

		public int Capacity => _chars.Length;

		public ref char this[int index] => ref _chars[index];

		public Span<char> RawChars => _chars;

		public ValueStringBuilder(Span<char> initialBuffer)
		{
			_arrayToReturnToPool = null;
			_chars = initialBuffer;
			_pos = 0;
		}

		public ValueStringBuilder(int initialCapacity)
		{
			_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity);
			_chars = _arrayToReturnToPool;
			_pos = 0;
		}

		public void EnsureCapacity(int capacity)
		{
			if ((uint)capacity > (uint)_chars.Length)
			{
				Grow(capacity - _pos);
			}
		}

		public ref char GetPinnableReference()
		{
			return ref MemoryMarshal.GetReference(_chars);
		}

		public ref char GetPinnableReference(bool terminate)
		{
			if (terminate)
			{
				EnsureCapacity(Length + 1);
				_chars[Length] = '\0';
			}
			return ref MemoryMarshal.GetReference(_chars);
		}

		public override string ToString()
		{
			string result = _chars.Slice(0, _pos).ToString();
			Dispose();
			return result;
		}

		public ReadOnlySpan<char> AsSpan(bool terminate)
		{
			if (terminate)
			{
				EnsureCapacity(Length + 1);
				_chars[Length] = '\0';
			}
			return _chars.Slice(0, _pos);
		}

		public ReadOnlySpan<char> AsSpan()
		{
			return _chars.Slice(0, _pos);
		}

		public ReadOnlySpan<char> AsSpan(int start)
		{
			return _chars.Slice(start, _pos - start);
		}

		public ReadOnlySpan<char> AsSpan(int start, int length)
		{
			return _chars.Slice(start, length);
		}

		public bool TryCopyTo(Span<char> destination, out int charsWritten)
		{
			if (_chars.Slice(0, _pos).TryCopyTo(destination))
			{
				charsWritten = _pos;
				Dispose();
				return true;
			}
			charsWritten = 0;
			Dispose();
			return false;
		}

		public void Insert(int index, char value, int count)
		{
			if (_pos > _chars.Length - count)
			{
				Grow(count);
			}
			int length = _pos - index;
			_chars.Slice(index, length).CopyTo(_chars.Slice(index + count));
			_chars.Slice(index, count).Fill(value);
			_pos += count;
		}

		public void Insert(int index, string? s)
		{
			if (s != null)
			{
				int length = s.Length;
				if (_pos > _chars.Length - length)
				{
					Grow(length);
				}
				int length2 = _pos - index;
				_chars.Slice(index, length2).CopyTo(_chars.Slice(index + length));
				s.AsSpan().CopyTo(_chars.Slice(index));
				_pos += length;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Append(char c)
		{
			int pos = _pos;
			if ((uint)pos < (uint)_chars.Length)
			{
				_chars[pos] = c;
				_pos = pos + 1;
			}
			else
			{
				GrowAndAppend(c);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Append(string? s)
		{
			if (s != null)
			{
				int pos = _pos;
				if (s.Length == 1 && (uint)pos < (uint)_chars.Length)
				{
					_chars[pos] = s[0];
					_pos = pos + 1;
				}
				else
				{
					AppendSlow(s);
				}
			}
		}

		private void AppendSlow(string s)
		{
			int pos = _pos;
			if (pos > _chars.Length - s.Length)
			{
				Grow(s.Length);
			}
			s.AsSpan().CopyTo(_chars.Slice(pos));
			_pos += s.Length;
		}

		public void Append(char c, int count)
		{
			if (_pos > _chars.Length - count)
			{
				Grow(count);
			}
			Span<char> span = _chars.Slice(_pos, count);
			for (int i = 0; i < span.Length; i++)
			{
				span[i] = c;
			}
			_pos += count;
		}

		public unsafe void Append(char* value, int length)
		{
			int pos = _pos;
			if (pos > _chars.Length - length)
			{
				Grow(length);
			}
			Span<char> span = _chars.Slice(_pos, length);
			for (int i = 0; i < span.Length; i++)
			{
				span[i] = *(value++);
			}
			_pos += length;
		}

		public void Append(ReadOnlySpan<char> value)
		{
			int pos = _pos;
			if (pos > _chars.Length - value.Length)
			{
				Grow(value.Length);
			}
			value.CopyTo(_chars.Slice(_pos));
			_pos += value.Length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span<char> AppendSpan(int length)
		{
			int pos = _pos;
			if (pos > _chars.Length - length)
			{
				Grow(length);
			}
			_pos = pos + length;
			return _chars.Slice(pos, length);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private void GrowAndAppend(char c)
		{
			Grow(1);
			Append(c);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private void Grow(int additionalCapacityBeyondPos)
		{
			int minimumLength = (int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), Math.Min((uint)(_chars.Length * 2), 2147483591u));
			char[] array = ArrayPool<char>.Shared.Rent(minimumLength);
			_chars.Slice(0, _pos).CopyTo(array);
			char[] arrayToReturnToPool = _arrayToReturnToPool;
			_chars = (_arrayToReturnToPool = array);
			if (arrayToReturnToPool != null)
			{
				ArrayPool<char>.Shared.Return(arrayToReturnToPool);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Dispose()
		{
			char[] arrayToReturnToPool = _arrayToReturnToPool;
			this = default(System.Text.ValueStringBuilder);
			if (arrayToReturnToPool != null)
			{
				ArrayPool<char>.Shared.Return(arrayToReturnToPool);
			}
		}
	}
}
namespace Microsoft.Extensions.Internal
{
	internal static class TypeNameHelper
	{
		private readonly struct DisplayNameOptions
		{
			public bool FullName { get; }

			public bool IncludeGenericParameters { get; }

			public bool IncludeGenericParameterNames { get; }

			public char NestedTypeDelimiter { get; }

			public DisplayNameOptions(bool fullName, bool includeGenericParameterNames, bool includeGenericParameters, char nestedTypeDelimiter)
			{
				FullName = fullName;
				IncludeGenericParameters = includeGenericParameters;
				IncludeGenericParameterNames = includeGenericParameterNames;
				NestedTypeDelimiter = nestedTypeDelimiter;
			}
		}

		private const char DefaultNestedTypeDelimiter = '+';

		private static readonly Dictionary<Type, string> _builtInTypeNames = new Dictionary<Type, string>
		{
			{
				typeof(void),
				"void"
			},
			{
				typeof(bool),
				"bool"
			},
			{
				typeof(byte),
				"byte"
			},
			{
				typeof(char),
				"char"
			},
			{
				typeof(decimal),
				"decimal"
			},
			{
				typeof(double),
				"double"
			},
			{
				typeof(float),
				"float"
			},
			{
				typeof(int),
				"int"
			},
			{
				typeof(long),
				"long"
			},
			{
				typeof(object),
				"object"
			},
			{
				typeof(sbyte),
				"sbyte"
			},
			{
				typeof(short),
				"short"
			},
			{
				typeof(string),
				"string"
			},
			{
				typeof(uint),
				"uint"
			},
			{
				typeof(ulong),
				"ulong"
			},
			{
				typeof(ushort),
				"ushort"
			}
		};

		[return: NotNullIfNotNull("item")]
		public static string? GetTypeDisplayName(object? item, bool fullName = true)
		{
			if (item != null)
			{
				return GetTypeDisplayName(item.GetType(), fullName);
			}
			return null;
		}

		public static string GetTypeDisplayName(Type type, bool fullName = true, bool includeGenericParameterNames = false, bool includeGenericParameters = true, char nestedTypeDelimiter = '+')
		{
			StringBuilder stringBuilder = new StringBuilder();
			DisplayNameOptions options = new DisplayNameOptions(fullName, includeGenericParameterNames, includeGenericParameters, nestedTypeDelimiter);
			ProcessType(stringBuilder, type, in options);
			return stringBuilder.ToString();
		}

		private static void ProcessType(StringBuilder builder, Type type, in DisplayNameOptions options)
		{
			if (type.IsGenericType)
			{
				Type[] genericArguments = type.GetGenericArguments();
				ProcessGenericType(builder, type, genericArguments, genericArguments.Length, in options);
				return;
			}
			if (type.IsArray)
			{
				ProcessArrayType(builder, type, in options);
				return;
			}
			if (_builtInTypeNames.TryGetValue(type, out var value))
			{
				builder.Append(value);
				return;
			}
			if (type.IsGenericParameter)
			{
				if (options.IncludeGenericParameterNames)
				{
					builder.Append(type.Name);
				}
				return;
			}
			string text = (options.FullName ? type.FullName : type.Name);
			builder.Append(text);
			if (options.NestedTypeDelimiter != '+')
			{
				builder.Replace('+', options.NestedTypeDelimiter, builder.Length - text.Length, text.Length);
			}
		}

		private static void ProcessArrayType(StringBuilder builder, Type type, in DisplayNameOptions options)
		{
			Type type2 = type;
			while (type2.IsArray)
			{
				type2 = type2.GetElementType();
			}
			ProcessType(builder, type2, in options);
			while (type.IsArray)
			{
				builder.Append('[');
				builder.Append(',', type.GetArrayRank() - 1);
				builder.Append(']');
				type = type.GetElementType();
			}
		}

		private static void ProcessGenericType(StringBuilder builder, Type type, Type[] genericArguments, int length, in DisplayNameOptions options)
		{
			int num = 0;
			if (type.IsNested)
			{
				num = type.DeclaringType.GetGenericArguments().Length;
			}
			if (options.FullName)
			{
				if (type.IsNested)
				{
					ProcessGenericType(builder, type.DeclaringType, genericArguments, num, in options);
					builder.Append(options.NestedTypeDelimiter);
				}
				else if (!string.IsNullOrEmpty(type.Namespace))
				{
					builder.Append(type.Namespace);
					builder.Append('.');
				}
			}
			int num2 = type.Name.IndexOf('`');
			if (num2 <= 0)
			{
				builder.Append(type.Name);
				return;
			}
			builder.Append(type.Name, 0, num2);
			if (!options.IncludeGenericParameters)
			{
				return;
			}
			builder.Append('<');
			for (int i = num; i < length; i++)
			{
				ProcessType(builder, genericArguments[i], in options);
				if (i + 1 != length)
				{
					builder.Append(',');
					if (options.IncludeGenericParameterNames || !genericArguments[i + 1].IsGenericParameter)
					{
						builder.Append(' ');
					}
				}
			}
			builder.Append('>');
		}
	}
}
namespace Microsoft.Extensions.Logging
{
	public readonly struct EventId : IEquatable<EventId>
	{
		public int Id { get; }

		public string? Name { get; }

		public static implicit operator EventId(int i)
		{
			return new EventId(i);
		}

		public static bool operator ==(EventId left, EventId right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(EventId left, EventId right)
		{
			return !left.Equals(right);
		}

		public EventId(int id, string? name = null)
		{
			Id = id;
			Name = name;
		}

		public override string ToString()
		{
			return Name ?? Id.ToString();
		}

		public bool Equals(EventId other)
		{
			return Id == other.Id;
		}

		public override bool Equals([NotNullWhen(true)] object? obj)
		{
			if (obj == null)
			{
				return false;
			}
			if (obj is EventId other)
			{
				return Equals(other);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return Id;
		}
	}
	internal readonly struct FormattedLogValues : IReadOnlyList<KeyValuePair<string, object?>>, IReadOnlyCollection<KeyValuePair<string, object?>>, IEnumerable<KeyValuePair<string, object?>>, IEnumerable
	{
		internal const int MaxCachedFormatters = 1024;

		private const string NullFormat = "[null]";

		private static int _count;

		private static ConcurrentDictionary<string, LogValuesFormatter> _formatters = new ConcurrentDictionary<string, LogValuesFormatter>();

		private readonly LogValuesFormatter _formatter;

		private readonly object[] _values;

		private readonly string _originalMessage;

		internal LogValuesFormatter? Formatter => _formatter;

		public KeyValuePair<string, object?> this[int index]
		{
			get
			{
				if (index < 0 || index >= Count)
				{
					throw new IndexOutOfRangeException("index");
				}
				if (index == Count - 1)
				{
					return new KeyValuePair<string, object>("{OriginalFormat}", _originalMessage);
				}
				return _formatter.GetValue(_values, index);
			}
		}

		public int Count
		{
			get
			{
				if (_formatter == null)
				{
					return 1;
				}
				return _formatter.ValueNames.Count + 1;
			}
		}

		public FormattedLogValues(string? format, params object?[]? values)
		{
			if (values != null && values.Length != 0 && format != null)
			{
				if (_count >= 1024)
				{
					if (!_formatters.TryGetValue(format, out _formatter))
					{
						_formatter = new LogValuesFormatter(format);
					}
				}
				else
				{
					_formatter = _formatters.GetOrAdd(format, delegate(string f)
					{
						Interlocked.Increment(ref _count);
						return new LogValuesFormatter(f);
					});
				}
			}
			else
			{
				_formatter = null;
			}
			_originalMessage = format ?? "[null]";
			_values = values;
		}

		public IEnumerator<KeyValuePair<string, object?>> GetEnumerator()
		{
			int i = 0;
			while (i < Count)
			{
				yield return this[i];
				int num = i + 1;
				i = num;
			}
		}

		public override string ToString()
		{
			if (_formatter == null)
			{
				return _originalMessage;
			}
			return _formatter.Format(_values);
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
	public interface IExternalScopeProvider
	{
		void ForEachScope<TState>(Action<object?, TState> callback, TState state);

		IDisposable Push(object? state);
	}
	public interface ILogger
	{
		void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter);

		bool IsEnabled(LogLevel logLevel);

		IDisposable? BeginScope<TState>(TState state) where TState : notnull;
	}
	public interface ILoggerFactory : IDisposable
	{
		ILogger CreateLogger(string categoryName);

		void AddProvider(ILoggerProvider provider);
	}
	public interface ILoggerProvider : IDisposable
	{
		ILogger CreateLogger(string categoryName);
	}
	public interface ILogger<out TCategoryName> : ILogger
	{
	}
	public interface ISupportExternalScope
	{
		void SetScopeProvider(IExternalScopeProvider scopeProvider);
	}
	public class LogDefineOptions
	{
		public bool SkipEnabledCheck { get; set; }
	}
	public static class LoggerExtensions
	{
		private static readonly Func<FormattedLogValues, Exception, string> _messageFormatter = MessageFormatter;

		public static void LogDebug(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Debug, eventId, exception, message, args);
		}

		public static void LogDebug(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Debug, eventId, message, args);
		}

		public static void LogDebug(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Debug, exception, message, args);
		}

		public static void LogDebug(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Debug, message, args);
		}

		public static void LogTrace(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Trace, eventId, exception, message, args);
		}

		public static void LogTrace(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Trace, eventId, message, args);
		}

		public static void LogTrace(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Trace, exception, message, args);
		}

		public static void LogTrace(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Trace, message, args);
		}

		public static void LogInformation(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Information, eventId, exception, message, args);
		}

		public static void LogInformation(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Information, eventId, message, args);
		}

		public static void LogInformation(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Information, exception, message, args);
		}

		public static void LogInformation(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Information, message, args);
		}

		public static void LogWarning(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Warning, eventId, exception, message, args);
		}

		public static void LogWarning(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Warning, eventId, message, args);
		}

		public static void LogWarning(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Warning, exception, message, args);
		}

		public static void LogWarning(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Warning, message, args);
		}

		public static void LogError(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Error, eventId, exception, message, args);
		}

		public static void LogError(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Error, eventId, message, args);
		}

		public static void LogError(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Error, exception, message, args);
		}

		public static void LogError(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Error, message, args);
		}

		public static void LogCritical(this ILogger logger, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Critical, eventId, exception, message, args);
		}

		public static void LogCritical(this ILogger logger, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Critical, eventId, message, args);
		}

		public static void LogCritical(this ILogger logger, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Critical, exception, message, args);
		}

		public static void LogCritical(this ILogger logger, string? message, params object?[] args)
		{
			logger.Log(LogLevel.Critical, message, args);
		}

		public static void Log(this ILogger logger, LogLevel logLevel, string? message, params object?[] args)
		{
			logger.Log(logLevel, 0, null, message, args);
		}

		public static void Log(this ILogger logger, LogLevel logLevel, EventId eventId, string? message, params object?[] args)
		{
			logger.Log(logLevel, eventId, null, message, args);
		}

		public static void Log(this ILogger logger, LogLevel logLevel, Exception? exception, string? message, params object?[] args)
		{
			logger.Log(logLevel, 0, exception, message, args);
		}

		public static void Log(this ILogger logger, LogLevel logLevel, EventId eventId, Exception? exception, string? message, params object?[] args)
		{
			System.ThrowHelper.ThrowIfNull(logger, "logger");
			logger.Log(logLevel, eventId, new FormattedLogValues(message, args), exception, _messageFormatter);
		}

		public static IDisposable? BeginScope(this ILogger logger, string messageFormat, params object?[] args)
		{
			System.ThrowHelper.ThrowIfNull(logger, "logger");
			return logger.BeginScope(new FormattedLogValues(messageFormat, args));
		}

		private static string MessageFormatter(FormattedLogValues state, Exception error)
		{
			return state.ToString();
		}
	}
	public class LoggerExternalScopeProvider : IExternalScopeProvider
	{
		private sealed class Scope : IDisposable
		{
			private readonly LoggerExternalScopeProvider _provider;

			private bool _isDisposed;

			public Scope Parent { get; }

			public object State { get; }

			internal Scope(LoggerExternalScopeProvider provider, object state, Scope parent)
			{
				_provider = provider;
				State = state;
				Parent = parent;
			}

			public override string ToString()
			{
				return State?.ToString();
			}

			public void Dispose()
			{
				if (!_isDisposed)
				{
					_provider._currentScope.Value = Parent;
					_isDisposed = true;
				}
			}
		}

		private readonly AsyncLocal<Scope> _currentScope = new AsyncLocal<Scope>();

		public void ForEachScope<TState>(Action<object?, TState> callback, TState state)
		{
			Action<object, TState> callback2 = callback;
			TState state2 = state;
			Report(_currentScope.Value);
			void Report(Scope? current)
			{
				if (current != null)
				{
					Report(current.Parent);
					callback2(current.State, state2);
				}
			}
		}

		public IDisposable Push(object? state)
		{
			Scope value = _currentScope.Value;
			Scope scope = new Scope(this, state, value);
			_currentScope.Value = scope;
			return scope;
		}
	}
	public static class LoggerFactoryExtensions
	{
		public static ILogger<T> CreateLogger<T>(this ILoggerFactory factory)
		{
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			return new Logger<T>(factory);
		}

		public static ILogger CreateLogger(this ILoggerFactory factory, Type type)
		{
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			System.ThrowHelper.ThrowIfNull(type, "type");
			return factory.CreateLogger(TypeNameHelper.GetTypeDisplayName(type, fullName: true, includeGenericParameterNames: false, includeGenericParameters: false, '.'));
		}
	}
	public static class LoggerMessage
	{
		private readonly struct LogValues : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues, Exception, string> Callback = (LogValues state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			public KeyValuePair<string, object> this[int index]
			{
				get
				{
					if (index == 0)
					{
						return new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat);
					}
					throw new IndexOutOfRangeException("index");
				}
			}

			public int Count => 1;

			public LogValues(LogValuesFormatter formatter)
			{
				_formatter = formatter;
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				yield return this[0];
			}

			public override string ToString()
			{
				return _formatter.Format();
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0>, Exception, string> Callback = (LogValues<T0> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public int Count => 2;

			public LogValues(LogValuesFormatter formatter, T0 value0)
			{
				_formatter = formatter;
				_value0 = value0;
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			public override string ToString()
			{
				return _formatter.Format(_value0);
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0, T1> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0, T1>, Exception, string> Callback = (LogValues<T0, T1> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			private readonly T1 _value1;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>(_formatter.ValueNames[1], _value1), 
				2 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public int Count => 3;

			public LogValues(LogValuesFormatter formatter, T0 value0, T1 value1)
			{
				_formatter = formatter;
				_value0 = value0;
				_value1 = value1;
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			public override string ToString()
			{
				return _formatter.Format(_value0, _value1);
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0, T1, T2> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0, T1, T2>, Exception, string> Callback = (LogValues<T0, T1, T2> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			private readonly T1 _value1;

			private readonly T2 _value2;

			public int Count => 4;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>(_formatter.ValueNames[1], _value1), 
				2 => new KeyValuePair<string, object>(_formatter.ValueNames[2], _value2), 
				3 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public LogValues(LogValuesFormatter formatter, T0 value0, T1 value1, T2 value2)
			{
				_formatter = formatter;
				_value0 = value0;
				_value1 = value1;
				_value2 = value2;
			}

			public override string ToString()
			{
				return _formatter.Format(_value0, _value1, _value2);
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0, T1, T2, T3> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0, T1, T2, T3>, Exception, string> Callback = (LogValues<T0, T1, T2, T3> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			private readonly T1 _value1;

			private readonly T2 _value2;

			private readonly T3 _value3;

			public int Count => 5;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>(_formatter.ValueNames[1], _value1), 
				2 => new KeyValuePair<string, object>(_formatter.ValueNames[2], _value2), 
				3 => new KeyValuePair<string, object>(_formatter.ValueNames[3], _value3), 
				4 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public LogValues(LogValuesFormatter formatter, T0 value0, T1 value1, T2 value2, T3 value3)
			{
				_formatter = formatter;
				_value0 = value0;
				_value1 = value1;
				_value2 = value2;
				_value3 = value3;
			}

			private object[] ToArray()
			{
				return new object[4] { _value0, _value1, _value2, _value3 };
			}

			public override string ToString()
			{
				return _formatter.FormatWithOverwrite(ToArray());
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0, T1, T2, T3, T4> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0, T1, T2, T3, T4>, Exception, string> Callback = (LogValues<T0, T1, T2, T3, T4> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			private readonly T1 _value1;

			private readonly T2 _value2;

			private readonly T3 _value3;

			private readonly T4 _value4;

			public int Count => 6;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>(_formatter.ValueNames[1], _value1), 
				2 => new KeyValuePair<string, object>(_formatter.ValueNames[2], _value2), 
				3 => new KeyValuePair<string, object>(_formatter.ValueNames[3], _value3), 
				4 => new KeyValuePair<string, object>(_formatter.ValueNames[4], _value4), 
				5 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public LogValues(LogValuesFormatter formatter, T0 value0, T1 value1, T2 value2, T3 value3, T4 value4)
			{
				_formatter = formatter;
				_value0 = value0;
				_value1 = value1;
				_value2 = value2;
				_value3 = value3;
				_value4 = value4;
			}

			private object[] ToArray()
			{
				return new object[5] { _value0, _value1, _value2, _value3, _value4 };
			}

			public override string ToString()
			{
				return _formatter.FormatWithOverwrite(ToArray());
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private readonly struct LogValues<T0, T1, T2, T3, T4, T5> : IReadOnlyList<KeyValuePair<string, object>>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
		{
			public static readonly Func<LogValues<T0, T1, T2, T3, T4, T5>, Exception, string> Callback = (LogValues<T0, T1, T2, T3, T4, T5> state, Exception exception) => state.ToString();

			private readonly LogValuesFormatter _formatter;

			private readonly T0 _value0;

			private readonly T1 _value1;

			private readonly T2 _value2;

			private readonly T3 _value3;

			private readonly T4 _value4;

			private readonly T5 _value5;

			public int Count => 7;

			public KeyValuePair<string, object> this[int index] => index switch
			{
				0 => new KeyValuePair<string, object>(_formatter.ValueNames[0], _value0), 
				1 => new KeyValuePair<string, object>(_formatter.ValueNames[1], _value1), 
				2 => new KeyValuePair<string, object>(_formatter.ValueNames[2], _value2), 
				3 => new KeyValuePair<string, object>(_formatter.ValueNames[3], _value3), 
				4 => new KeyValuePair<string, object>(_formatter.ValueNames[4], _value4), 
				5 => new KeyValuePair<string, object>(_formatter.ValueNames[5], _value5), 
				6 => new KeyValuePair<string, object>("{OriginalFormat}", _formatter.OriginalFormat), 
				_ => throw new IndexOutOfRangeException("index"), 
			};

			public LogValues(LogValuesFormatter formatter, T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)
			{
				_formatter = formatter;
				_value0 = value0;
				_value1 = value1;
				_value2 = value2;
				_value3 = value3;
				_value4 = value4;
				_value5 = value5;
			}

			private object[] ToArray()
			{
				return new object[6] { _value0, _value1, _value2, _value3, _value4, _value5 };
			}

			public override string ToString()
			{
				return _formatter.FormatWithOverwrite(ToArray());
			}

			public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
			{
				int i = 0;
				while (i < Count)
				{
					yield return this[i];
					int num = i + 1;
					i = num;
				}
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		public static Func<ILogger, IDisposable?> DefineScope(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 0);
			LogValues logValues = new LogValues(formatter);
			return (ILogger logger) => logger.BeginScope(logValues);
		}

		public static Func<ILogger, T1, IDisposable?> DefineScope<T1>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 1);
			return (ILogger logger, T1 arg1) => logger.BeginScope(new LogValues<T1>(formatter, arg1));
		}

		public static Func<ILogger, T1, T2, IDisposable?> DefineScope<T1, T2>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 2);
			return (ILogger logger, T1 arg1, T2 arg2) => logger.BeginScope(new LogValues<T1, T2>(formatter, arg1, arg2));
		}

		public static Func<ILogger, T1, T2, T3, IDisposable?> DefineScope<T1, T2, T3>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 3);
			return (ILogger logger, T1 arg1, T2 arg2, T3 arg3) => logger.BeginScope(new LogValues<T1, T2, T3>(formatter, arg1, arg2, arg3));
		}

		public static Func<ILogger, T1, T2, T3, T4, IDisposable?> DefineScope<T1, T2, T3, T4>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 4);
			return (ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4) => logger.BeginScope(new LogValues<T1, T2, T3, T4>(formatter, arg1, arg2, arg3, arg4));
		}

		public static Func<ILogger, T1, T2, T3, T4, T5, IDisposable?> DefineScope<T1, T2, T3, T4, T5>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 5);
			return (ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) => logger.BeginScope(new LogValues<T1, T2, T3, T4, T5>(formatter, arg1, arg2, arg3, arg4, arg5));
		}

		public static Func<ILogger, T1, T2, T3, T4, T5, T6, IDisposable?> DefineScope<T1, T2, T3, T4, T5, T6>(string formatString)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 6);
			return (ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) => logger.BeginScope(new LogValues<T1, T2, T3, T4, T5, T6>(formatter, arg1, arg2, arg3, arg4, arg5, arg6));
		}

		public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 0);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, exception);
				}
			};
			void Log(ILogger logger, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues(formatter), exception, LogValues.Callback);
			}
		}

		public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 1);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1>(formatter, arg1), exception, LogValues<T1>.Callback);
			}
		}

		public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1, T2>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 2);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, T2 arg2, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, arg2, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, T2 arg2, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1, T2>(formatter, arg1, arg2), exception, LogValues<T1, T2>.Callback);
			}
		}

		public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1, T2, T3>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 3);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, T2 arg2, T3 arg3, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, arg2, arg3, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1, T2, T3>(formatter, arg1, arg2, arg3), exception, LogValues<T1, T2, T3>.Callback);
			}
		}

		public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1, T2, T3, T4>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 4);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, arg2, arg3, arg4, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1, T2, T3, T4>(formatter, arg1, arg2, arg3, arg4), exception, LogValues<T1, T2, T3, T4>.Callback);
			}
		}

		public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1, T2, T3, T4, T5>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 5);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, arg2, arg3, arg4, arg5, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1, T2, T3, T4, T5>(formatter, arg1, arg2, arg3, arg4, arg5), exception, LogValues<T1, T2, T3, T4, T5>.Callback);
			}
		}

		public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString)
		{
			return Define<T1, T2, T3, T4, T5, T6>(logLevel, eventId, formatString, null);
		}

		public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
		{
			LogValuesFormatter formatter = CreateLogValuesFormatter(formatString, 6);
			if (options != null && options.SkipEnabledCheck)
			{
				return Log;
			}
			return delegate(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, Exception exception)
			{
				if (logger.IsEnabled(logLevel))
				{
					Log(logger, arg1, arg2, arg3, arg4, arg5, arg6, exception);
				}
			};
			void Log(ILogger logger, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, Exception exception)
			{
				logger.Log(logLevel, eventId, new LogValues<T1, T2, T3, T4, T5, T6>(formatter, arg1, arg2, arg3, arg4, arg5, arg6), exception, LogValues<T1, T2, T3, T4, T5, T6>.Callback);
			}
		}

		private static LogValuesFormatter CreateLogValuesFormatter(string formatString, int expectedNamedParameterCount)
		{
			LogValuesFormatter logValuesFormatter = new LogValuesFormatter(formatString);
			int count = logValuesFormatter.ValueNames.Count;
			if (count != expectedNamedParameterCount)
			{
				throw new ArgumentException(System.SR.Format(System.SR.UnexpectedNumberOfNamedParameters, formatString, expectedNamedParameterCount, count));
			}
			return logValuesFormatter;
		}
	}
	[AttributeUsage(AttributeTargets.Method)]
	public sealed class LoggerMessageAttribute : Attribute
	{
		public int EventId { get; set; } = -1;


		public string? EventName { get; set; }

		public LogLevel Level { get; set; } = LogLevel.None;


		public string Message { get; set; } = "";


		public bool SkipEnabledCheck { get; set; }

		public LoggerMessageAttribute()
		{
		}

		public LoggerMessageAttribute(int eventId, LogLevel level, string message)
		{
			EventId = eventId;
			Level = level;
			Message = message;
		}
	}
	public class Logger<T> : ILogger<T>, ILogger
	{
		private readonly ILogger _logger;

		public Logger(ILoggerFactory factory)
		{
			System.ThrowHelper.ThrowIfNull(factory, "factory");
			_logger = factory.CreateLogger(TypeNameHelper.GetTypeDisplayName(typeof(T), fullName: true, includeGenericParameterNames: false, includeGenericParameters: false, '.'));
		}

		IDisposable ILogger.BeginScope<TState>(TState state)
		{
			return _logger.BeginScope(state);
		}

		bool ILogger.IsEnabled(LogLevel logLevel)
		{
			return _logger.IsEnabled(logLevel);
		}

		void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
		{
			_logger.Log(logLevel, eventId, state, exception, formatter);
		}
	}
	public enum LogLevel
	{
		Trace,
		Debug,
		Information,
		Warning,
		Error,
		Critical,
		None
	}
	internal sealed class LogValuesFormatter
	{
		private const string NullValue = "(null)";

		private static readonly char[] FormatDelimiters = new char[2] { ',', ':' };

		private readonly string _format;

		private readonly List<string> _valueNames = new List<string>();

		public string OriginalFormat { get; private set; }

		public List<string> ValueNames => _valueNames;

		public LogValuesFormatter(string format)
		{
			System.ThrowHelper.ThrowIfNull(format, "format");
			OriginalFormat = format;
			Span<char> initialBuffer = stackalloc char[256];
			System.Text.ValueStringBuilder valueStringBuilder = new System.Text.ValueStringBuilder(initialBuffer);
			int num = 0;
			int length = format.Length;
			while (num < length)
			{
				int num2 = FindBraceIndex(format, '{', num, length);
				if (num == 0 && num2 == length)
				{
					_format = format;
					return;
				}
				int num3 = FindBraceIndex(format, '}', num2, length);
				if (num3 == length)
				{
					valueStringBuilder.Append(format.AsSpan(num, length - num));
					num = length;
					continue;
				}
				int num4 = FindIndexOfAny(format, FormatDelimiters, num2, num3);
				valueStringBuilder.Append(format.AsSpan(num, num2 - num + 1));
				valueStringBuilder.Append(_valueNames.Count.ToString());
				_valueNames.Add(format.Substring(num2 + 1, num4 - num2 - 1));
				valueStringBuilder.Append(format.AsSpan(num4, num3 - num4 + 1));
				num = num3 + 1;
			}
			_format = valueStringBuilder.ToString();
		}

		private static int FindBraceIndex(string format, char brace, int startIndex, int endIndex)
		{
			int result = endIndex;
			int i = startIndex;
			int num = 0;
			for (; i < endIndex; i++)
			{
				if (num > 0 && format[i] != brace)
				{
					if (num % 2 != 0)
					{
						break;
					}
					num = 0;
					result = endIndex;
				}
				else
				{
					if (format[i] != brace)
					{
						continue;
					}
					if (brace == '}')
					{
						if (num == 0)
						{
							result = i;
						}
					}
					else
					{
						result = i;
					}
					num++;
				}
			}
			return result;
		}

		private static int FindIndexOfAny(string format, char[] chars, int startIndex, int endIndex)
		{
			int num = format.IndexOfAny(chars, startIndex, endIndex - startIndex);
			if (num != -1)
			{
				return num;
			}
			return endIndex;
		}

		public string Format(object?[]? values)
		{
			object[] array = values;
			if (values != null)
			{
				for (int i = 0; i < values.Length; i++)
				{
					object obj = FormatArgument(values[i]);
					if (obj != values[i])
					{
						array = new object[values.Length];
						Array.Copy(values, array, i);
						array[i++] = obj;
						for (; i < values.Length; i++)
						{
							array[i] = FormatArgument(values[i]);
						}
						break;
					}
				}
			}
			return string.Format(CultureInfo.InvariantCulture, _format, array ?? Array.Empty<object>());
		}

		internal string FormatWithOverwrite(object?[]? values)
		{
			if (values != null)
			{
				for (int i = 0; i < values.Length; i++)
				{
					values[i] = FormatArgument(values[i]);
				}
			}
			return string.Format(CultureInfo.InvariantCulture, _format, values ?? Array.Empty<object>());
		}

		internal string Format()
		{
			return _format;
		}

		internal string Format(object? arg0)
		{
			return string.Format(CultureInfo.InvariantCulture, _format, FormatArgument(arg0));
		}

		internal string Format(object? arg0, object? arg1)
		{
			return string.Format(CultureInfo.InvariantCulture, _format, FormatArgument(arg0), FormatArgument(arg1));
		}

		internal string Format(object? arg0, object? arg1, object? arg2)
		{
			return string.Format(CultureInfo.InvariantCulture, _format, FormatArgument(arg0), FormatArgument(arg1), FormatArgument(arg2));
		}

		public KeyValuePair<string, object?> GetValue(object?[] values, int index)
		{
			if (index < 0 || index > _valueNames.Count)
			{
				throw new IndexOutOfRangeException("index");
			}
			if (_valueNames.Count > index)
			{
				return new KeyValuePair<string, object>(_valueNames[index], values[index]);
			}
			return new KeyValuePair<string, object>("{OriginalFormat}", OriginalFormat);
		}

		public IEnumerable<KeyValuePair<string, object?>> GetValues(object[] values)
		{
			KeyValuePair<string, object>[] array = new KeyValuePair<string, object>[values.Length + 1];
			for (int i = 0; i != _valueNames.Count; i++)
			{
				array[i] = new KeyValuePair<string, object>(_valueNames[i], values[i]);
			}
			array[^1] = new KeyValuePair<string, object>("{OriginalFormat}", OriginalFormat);
			return array;
		}

		private object FormatArgument(object value)
		{
			if (value == null)
			{
				return "(null)";
			}
			if (value is string)
			{
				return value;
			}
			if (value is IEnumerable enumerable)
			{
				Span<char> initialBuffer = stackalloc char[256];
				System.Text.ValueStringBuilder valueStringBuilder = new System.Text.ValueStringBuilder(initialBuffer);
				bool flag = true;
				foreach (object item in enumerable)
				{
					if (!flag)
					{
						valueStringBuilder.Append(", ");
					}
					valueStringBuilder.Append((item != null) ? item.ToString() : "(null)");
					flag = false;
				}
				return valueStringBuilder.ToString();
			}
			return value;
		}
	}
	internal sealed class NullExternalScopeProvider : IExternalScopeProvider
	{
		public static IExternalScopeProvider Instance { get; } = new NullExternalScopeProvider();


		private NullExternalScopeProvider()
		{
		}

		void IExternalScopeProvider.ForEachScope<TState>(Action<object, TState> callback, TState state)
		{
		}

		IDisposable IExternalScopeProvider.Push(object state)
		{
			return NullScope.Instance;
		}
	}
	internal sealed class NullScope : IDisposable
	{
		public static NullScope Instance { get; } = new NullScope();


		private NullScope()
		{
		}

		public void Dispose()
		{
		}
	}
}
namespace Microsoft.Extensions.Logging.Abstractions
{
	public readonly struct LogEntry<TState>
	{
		public LogLevel LogLevel { get; }

		public string Category { get; }

		public EventId EventId { get; }

		public TState State { get; }

		public Exception? Exception { get; }

		public Func<TState, Exception?, string> Formatter { get; }

		public LogEntry(LogLevel logLevel, string category, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
		{
			LogLevel = logLevel;
			Category = category;
			EventId = eventId;
			State = state;
			Exception = exception;
			Formatter = formatter;
		}
	}
	public class NullLogger : ILogger
	{
		public static NullLogger Instance { get; } = new NullLogger();


		private NullLogger()
		{
		}

		public IDisposable BeginScope<TState>(TState state) where TState : notnull
		{
			return NullScope.Instance;
		}

		public bool IsEnabled(LogLevel logLevel)
		{
			return false;
		}

		public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
		{
		}
	}
	public class NullLoggerFactory : ILoggerFactory, IDisposable
	{
		public static readonly NullLoggerFactory Instance = new NullLoggerFactory();

		public ILogger CreateLogger(string name)
		{
			return NullLogger.Instance;
		}

		public void AddProvider(ILoggerProvider provider)
		{
		}

		public void Dispose()
		{
		}
	}
	public class NullLoggerProvider : ILoggerProvider, IDisposable
	{
		public static NullLoggerProvider Instance { get; } = new NullLoggerProvider();


		private NullLoggerProvider()
		{
		}

		public ILogger CreateLogger(string categoryName)
		{
			return NullLogger.Instance;
		}

		public void Dispose()
		{
		}
	}
	public class NullLogger<T> : ILogger<T>, ILogger
	{
		public static readonly NullLogger<T> Instance = new NullLogger<T>();

		public IDisposable BeginScope<TState>(TState state) where TState : notnull
		{
			return NullScope.Instance;
		}

		public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
		{
		}

		public bool IsEnabled(LogLevel logLevel)
		{
			return false;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Logging.Configuration.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using FxResources.Microsoft.Extensions.Logging.Configuration;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging.Configuration;
using Microsoft.Extensions.Options;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Logging.Configuration")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Configuration support for Microsoft.Extensions.Logging.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Configuration")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Logging.Configuration
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string ValueNotSupported => GetResourceString("ValueNotSupported");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string Scope { get; set; }

		public string Target { get; set; }

		public string MessageId { get; set; }

		public string Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresUnreferencedCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresUnreferencedCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Logging
{
	internal sealed class LoggerFilterConfigureOptions : IConfigureOptions<LoggerFilterOptions>
	{
		private const string LogLevelKey = "LogLevel";

		private const string DefaultCategory = "Default";

		private readonly IConfiguration _configuration;

		public LoggerFilterConfigureOptions(IConfiguration configuration)
		{
			_configuration = configuration;
		}

		public void Configure(LoggerFilterOptions options)
		{
			LoadDefaultConfigValues(options);
		}

		private void LoadDefaultConfigValues(LoggerFilterOptions options)
		{
			if (_configuration == null)
			{
				return;
			}
			options.CaptureScopes = GetCaptureScopesValue(options);
			foreach (IConfigurationSection child in _configuration.GetChildren())
			{
				if (child.Key.Equals("LogLevel", StringComparison.OrdinalIgnoreCase))
				{
					LoadRules(options, child, null);
					continue;
				}
				IConfigurationSection section = ((IConfiguration)child).GetSection("LogLevel");
				if (section != null)
				{
					string key = child.Key;
					LoadRules(options, section, key);
				}
			}
			[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "IConfiguration.GetValue is safe when T is a bool.")]
			bool GetCaptureScopesValue(LoggerFilterOptions options)
			{
				return ConfigurationBinder.GetValue<bool>(_configuration, "CaptureScopes", options.CaptureScopes);
			}
		}

		private static void LoadRules(LoggerFilterOptions options, IConfigurationSection configurationSection, string logger)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			foreach (KeyValuePair<string, string> item2 in ConfigurationExtensions.AsEnumerable((IConfiguration)(object)configurationSection, true))
			{
				if (TryGetSwitch(item2.Value, out var level))
				{
					string text = item2.Key;
					if (text.Equals("Default", StringComparison.OrdinalIgnoreCase))
					{
						text = null;
					}
					LoggerFilterRule item = new LoggerFilterRule(logger, text, (LogLevel?)level, (Func<string, string, LogLevel, bool>)null);
					options.Rules.Add(item);
				}
			}
		}

		private static bool TryGetSwitch(string value, out LogLevel level)
		{
			if (string.IsNullOrEmpty(value))
			{
				level = (LogLevel)6;
				return false;
			}
			if (Enum.TryParse<LogLevel>(value, ignoreCase: true, out level))
			{
				return true;
			}
			throw new InvalidOperationException(System.SR.Format(System.SR.ValueNotSupported, value));
		}
	}
	public static class LoggingBuilderExtensions
	{
		public static ILoggingBuilder AddConfiguration(this ILoggingBuilder builder, IConfiguration configuration)
		{
			builder.AddConfiguration();
			ServiceCollectionServiceExtensions.AddSingleton<IConfigureOptions<LoggerFilterOptions>>(builder.Services, (IConfigureOptions<LoggerFilterOptions>)new LoggerFilterConfigureOptions(configuration));
			ServiceCollectionServiceExtensions.AddSingleton<IOptionsChangeTokenSource<LoggerFilterOptions>>(builder.Services, (IOptionsChangeTokenSource<LoggerFilterOptions>)(object)new ConfigurationChangeTokenSource<LoggerFilterOptions>(configuration));
			ServiceCollectionServiceExtensions.AddSingleton<LoggingConfiguration>(builder.Services, new LoggingConfiguration(configuration));
			return builder;
		}
	}
	internal static class ProviderAliasUtilities
	{
		private const string AliasAttributeTypeFullName = "Microsoft.Extensions.Logging.ProviderAliasAttribute";

		internal static string GetAlias(Type providerType)
		{
			IList<CustomAttributeData> customAttributes = CustomAttributeData.GetCustomAttributes(providerType);
			for (int i = 0; i < customAttributes.Count; i++)
			{
				CustomAttributeData customAttributeData = customAttributes[i];
				if (customAttributeData.AttributeType.FullName == "Microsoft.Extensions.Logging.ProviderAliasAttribute" && customAttributeData.ConstructorArguments.Count > 0)
				{
					return customAttributeData.ConstructorArguments[0].Value?.ToString();
				}
			}
			return null;
		}
	}
}
namespace Microsoft.Extensions.Logging.Configuration
{
	public interface ILoggerProviderConfiguration<T>
	{
		IConfiguration Configuration { get; }
	}
	public interface ILoggerProviderConfigurationFactory
	{
		IConfiguration GetConfiguration(Type providerType);
	}
	internal sealed class LoggerProviderConfiguration<T> : ILoggerProviderConfiguration<T>
	{
		public IConfiguration Configuration { get; }

		public LoggerProviderConfiguration(ILoggerProviderConfigurationFactory providerConfigurationFactory)
		{
			Configuration = providerConfigurationFactory.GetConfiguration(typeof(T));
		}
	}
	public static class LoggerProviderOptions
	{
		internal const string RequiresDynamicCodeMessage = "Binding TOptions to configuration values may require generating dynamic code at runtime.";

		internal const string TrimmingRequiresUnreferencedCodeMessage = "TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.";

		[RequiresDynamicCode("Binding TOptions to configuration values may require generating dynamic code at runtime.")]
		[RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
		public static void RegisterProviderOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TOptions, TProvider>(IServiceCollection services) where TOptions : class
		{
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(services, ServiceDescriptor.Singleton<IConfigureOptions<TOptions>, LoggerProviderConfigureOptions<TOptions, TProvider>>());
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(services, ServiceDescriptor.Singleton<IOptionsChangeTokenSource<TOptions>, LoggerProviderOptionsChangeTokenSource<TOptions, TProvider>>());
		}
	}
	internal sealed class LoggerProviderConfigurationFactory : ILoggerProviderConfigurationFactory
	{
		private readonly IEnumerable<LoggingConfiguration> _configurations;

		public LoggerProviderConfigurationFactory(IEnumerable<LoggingConfiguration> configurations)
		{
			_configurations = configurations;
		}

		public IConfiguration GetConfiguration(Type providerType)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			System.ThrowHelper.ThrowIfNull(providerType, "providerType");
			string fullName = providerType.FullName;
			string alias = ProviderAliasUtilities.GetAlias(providerType);
			ConfigurationBuilder val = new ConfigurationBuilder();
			foreach (LoggingConfiguration configuration in _configurations)
			{
				IConfigurationSection section = configuration.Configuration.GetSection(fullName);
				ChainedBuilderExtensions.AddConfiguration((IConfigurationBuilder)(object)val, (IConfiguration)(object)section);
				if (!string.IsNullOrWhiteSpace(alias))
				{
					IConfigurationSection section2 = configuration.Configuration.GetSection(alias);
					ChainedBuilderExtensions.AddConfiguration((IConfigurationBuilder)(object)val, (IConfiguration)(object)section2);
				}
			}
			return (IConfiguration)(object)val.Build();
		}
	}
	internal sealed class LoggerProviderConfigureOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TOptions, TProvider> : ConfigureFromConfigurationOptions<TOptions> where TOptions : class
	{
		[RequiresDynamicCode("Binding TOptions to configuration values may require generating dynamic code at runtime.")]
		[RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
		public LoggerProviderConfigureOptions(ILoggerProviderConfiguration<TProvider> providerConfiguration)
			: base(providerConfiguration.Configuration)
		{
		}
	}
	public class LoggerProviderOptionsChangeTokenSource<TOptions, TProvider> : ConfigurationChangeTokenSource<TOptions>
	{
		public LoggerProviderOptionsChangeTokenSource(ILoggerProviderConfiguration<TProvider> providerConfiguration)
			: base(providerConfiguration.Configuration)
		{
		}
	}
	public static class LoggingBuilderConfigurationExtensions
	{
		public static void AddConfiguration(this ILoggingBuilder builder)
		{
			ServiceCollectionDescriptorExtensions.TryAddSingleton<ILoggerProviderConfigurationFactory, LoggerProviderConfigurationFactory>(builder.Services);
			ServiceCollectionDescriptorExtensions.TryAddSingleton(builder.Services, typeof(ILoggerProviderConfiguration<>), typeof(LoggerProviderConfiguration<>));
		}
	}
	internal sealed class LoggingConfiguration
	{
		public IConfiguration Configuration { get; }

		public LoggingConfiguration(IConfiguration configuration)
		{
			Configuration = configuration;
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Logging.Console.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using FxResources.Microsoft.Extensions.Logging.Console;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Logging.Configuration;
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Options;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Console.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Logging.Console")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Console logger provider implementation for Microsoft.Extensions.Logging.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Console")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("7.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(true)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal static class Interop
{
	internal static class Libraries
	{
		internal const string Activeds = "activeds.dll";

		internal const string Advapi32 = "advapi32.dll";

		internal const string Authz = "authz.dll";

		internal const string BCrypt = "BCrypt.dll";

		internal const string Credui = "credui.dll";

		internal const string Crypt32 = "crypt32.dll";

		internal const string CryptUI = "cryptui.dll";

		internal const string Dnsapi = "dnsapi.dll";

		internal const string Dsrole = "dsrole.dll";

		internal const string Gdi32 = "gdi32.dll";

		internal const string HttpApi = "httpapi.dll";

		internal const string IpHlpApi = "iphlpapi.dll";

		internal const string Kernel32 = "kernel32.dll";

		internal const string Logoncli = "logoncli.dll";

		internal const string Mswsock = "mswsock.dll";

		internal const string NCrypt = "ncrypt.dll";

		internal const string Netapi32 = "netapi32.dll";

		internal const string Netutils = "netutils.dll";

		internal const string NtDll = "ntdll.dll";

		internal const string Odbc32 = "odbc32.dll";

		internal const string Ole32 = "ole32.dll";

		internal const string OleAut32 = "oleaut32.dll";

		internal const string Pdh = "pdh.dll";

		internal const string Secur32 = "secur32.dll";

		internal const string Shell32 = "shell32.dll";

		internal const string SspiCli = "sspicli.dll";

		internal const string User32 = "user32.dll";

		internal const string Version = "version.dll";

		internal const string WebSocket = "websocket.dll";

		internal const string Wevtapi = "wevtapi.dll";

		internal const string WinHttp = "winhttp.dll";

		internal const string WinMM = "winmm.dll";

		internal const string Wkscli = "wkscli.dll";

		internal const string Wldap32 = "wldap32.dll";

		internal const string Ws2_32 = "ws2_32.dll";

		internal const string Wtsapi32 = "wtsapi32.dll";

		internal const string CompressionNative = "System.IO.Compression.Native";

		internal const string GlobalizationNative = "System.Globalization.Native";

		internal const string MsQuic = "msquic.dll";

		internal const string HostPolicy = "hostpolicy.dll";

		internal const string Ucrtbase = "ucrtbase.dll";

		internal const string Xolehlp = "xolehlp.dll";
	}

	internal static class Kernel32
	{
		internal const int ENABLE_PROCESSED_INPUT = 1;

		internal const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4u;

		internal const int STD_OUTPUT_HANDLE = -11;

		[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
		[LibraryImport("kernel32.dll", SetLastError = true)]
		[return: MarshalAs(UnmanagedType.Bool)]
		internal static extern bool GetConsoleMode(IntPtr handle, out int mode);

		internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle)
		{
			int mode;
			return GetConsoleMode(handle, out mode);
		}

		[DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
		[LibraryImport("kernel32.dll", SetLastError = true)]
		[return: MarshalAs(UnmanagedType.Bool)]
		internal static extern bool SetConsoleMode(IntPtr handle, int mode);

		[DllImport("kernel32.dll", ExactSpelling = true)]
		[LibraryImport("kernel32.dll")]
		internal static extern IntPtr GetStdHandle(int nStdHandle);
	}
}
namespace FxResources.Microsoft.Extensions.Logging.Console
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class ConsoleUtils
	{
		private static volatile int s_emitAnsiColorCodes = -1;

		private static volatile int s_useNet6KeyParser = -1;

		public static bool EmitAnsiColorCodes
		{
			get
			{
				int num = s_emitAnsiColorCodes;
				if (num != -1)
				{
					return Convert.ToBoolean(num);
				}
				bool flag;
				if (!Console.IsOutputRedirected)
				{
					flag = Environment.GetEnvironmentVariable("NO_COLOR") == null;
				}
				else
				{
					string environmentVariable = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION");
					flag = environmentVariable != null && (environmentVariable == "1" || environmentVariable.Equals("true", StringComparison.OrdinalIgnoreCase));
				}
				s_emitAnsiColorCodes = Convert.ToInt32(flag);
				return flag;
			}
		}

		internal static bool UseNet6KeyParser
		{
			get
			{
				int num = s_useNet6KeyParser;
				if (num == -1)
				{
					num = (s_useNet6KeyParser = (GetNet6CompatReadKeySetting() ? 1 : 0));
				}
				return num == 1;
				static bool GetNet6CompatReadKeySetting()
				{
					if (AppContext.TryGetSwitch("System.Console.UseNet6CompatReadKey", out var isEnabled))
					{
						return isEnabled;
					}
					string environmentVariable = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_USENET6COMPATREADKEY");
					if (environmentVariable != null)
					{
						if (!(environmentVariable == "1"))
						{
							return environmentVariable.Equals("true", StringComparison.OrdinalIgnoreCase);
						}
						return true;
					}
					return false;
				}
			}
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string BufferMaximumSizeExceeded => GetResourceString("BufferMaximumSizeExceeded");

		internal static string QueueModeNotSupported => GetResourceString("QueueModeNotSupported");

		internal static string MaxQueueLengthBadValue => GetResourceString("MaxQueueLengthBadValue");

		internal static string WarningMessageOnDrop => GetResourceString("WarningMessageOnDrop");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, object? p1, object? p2, object? p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider? provider, string resourceFormat, params object?[]? args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresUnreferencedCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresUnreferencedCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string? Scope { get; set; }

		public string? Target { get; set; }

		public string? MessageId { get; set; }

		public string? Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string? Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class StringSyntaxAttribute : Attribute
	{
		public const string CompositeFormat = "CompositeFormat";

		public const string DateOnlyFormat = "DateOnlyFormat";

		public const string DateTimeFormat = "DateTimeFormat";

		public const string EnumFormat = "EnumFormat";

		public const string GuidFormat = "GuidFormat";

		public const string Json = "Json";

		public const string NumericFormat = "NumericFormat";

		public const string Regex = "Regex";

		public const string TimeOnlyFormat = "TimeOnlyFormat";

		public const string TimeSpanFormat = "TimeSpanFormat";

		public const string Uri = "Uri";

		public const string Xml = "Xml";

		public string Syntax { get; }

		public object?[] Arguments { get; }

		public StringSyntaxAttribute(string syntax)
		{
			Syntax = syntax;
			Arguments = Array.Empty<object>();
		}

		public StringSyntaxAttribute(string syntax, params object?[] arguments)
		{
			Syntax = syntax;
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.Versioning
{
	internal abstract class OSPlatformAttribute : Attribute
	{
		public string PlatformName { get; }

		private protected OSPlatformAttribute(string platformName)
		{
			PlatformName = platformName;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
	internal sealed class TargetPlatformAttribute : OSPlatformAttribute
	{
		public TargetPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute
	{
		public string? Message { get; }

		public UnsupportedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public UnsupportedOSPlatformAttribute(string platformName, string? message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
	internal sealed class ObsoletedOSPlatformAttribute : OSPlatformAttribute
	{
		public string? Message { get; }

		public string? Url { get; set; }

		public ObsoletedOSPlatformAttribute(string platformName)
			: base(platformName)
		{
		}

		public ObsoletedOSPlatformAttribute(string platformName, string? message)
			: base(platformName)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class SupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public SupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class UnsupportedOSPlatformGuardAttribute : OSPlatformAttribute
	{
		public UnsupportedOSPlatformGuardAttribute(string platformName)
			: base(platformName)
		{
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string? EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type? StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace System.Text.Json
{
	internal sealed class PooledByteBufferWriter : IBufferWriter<byte>, IDisposable
	{
		private byte[] _rentedBuffer;

		private int _index;

		private const int MinimumBufferSize = 256;

		public ReadOnlyMemory<byte> WrittenMemory => _rentedBuffer.AsMemory(0, _index);

		public int WrittenCount => _index;

		public int Capacity => _rentedBuffer.Length;

		public int FreeCapacity => _rentedBuffer.Length - _index;

		private PooledByteBufferWriter()
		{
		}

		public PooledByteBufferWriter(int initialCapacity)
		{
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(initialCapacity);
			_index = 0;
		}

		public void Clear()
		{
			ClearHelper();
		}

		public void ClearAndReturnBuffers()
		{
			ClearHelper();
			byte[] rentedBuffer = _rentedBuffer;
			_rentedBuffer = null;
			ArrayPool<byte>.Shared.Return(rentedBuffer);
		}

		private void ClearHelper()
		{
			_rentedBuffer.AsSpan(0, _index).Clear();
			_index = 0;
		}

		public void Dispose()
		{
			if (_rentedBuffer != null)
			{
				ClearHelper();
				byte[] rentedBuffer = _rentedBuffer;
				_rentedBuffer = null;
				ArrayPool<byte>.Shared.Return(rentedBuffer);
			}
		}

		public void InitializeEmptyInstance(int initialCapacity)
		{
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(initialCapacity);
			_index = 0;
		}

		public static PooledByteBufferWriter CreateEmptyInstanceForCaching()
		{
			return new PooledByteBufferWriter();
		}

		public void Advance(int count)
		{
			_index += count;
		}

		public Memory<byte> GetMemory(int sizeHint = 0)
		{
			CheckAndResizeBuffer(sizeHint);
			return _rentedBuffer.AsMemory(_index);
		}

		public Span<byte> GetSpan(int sizeHint = 0)
		{
			CheckAndResizeBuffer(sizeHint);
			return _rentedBuffer.AsSpan(_index);
		}

		internal Task WriteToStreamAsync(Stream destination, CancellationToken cancellationToken)
		{
			return destination.WriteAsync(_rentedBuffer, 0, _index, cancellationToken);
		}

		internal void WriteToStream(Stream destination)
		{
			destination.Write(_rentedBuffer, 0, _index);
		}

		private void CheckAndResizeBuffer(int sizeHint)
		{
			if (sizeHint == 0)
			{
				sizeHint = 256;
			}
			int num = _rentedBuffer.Length - _index;
			if (sizeHint <= num)
			{
				return;
			}
			int num2 = _rentedBuffer.Length;
			int num3 = Math.Max(sizeHint, num2);
			int num4 = num2 + num3;
			if ((uint)num4 > 2147483647u)
			{
				num4 = num2 + sizeHint;
				if ((uint)num4 > 2147483647u)
				{
					ThrowHelper.ThrowOutOfMemoryException_BufferMaximumSizeExceeded((uint)num4);
				}
			}
			byte[] rentedBuffer = _rentedBuffer;
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(num4);
			Span<byte> span = rentedBuffer.AsSpan(0, _index);
			span.CopyTo(_rentedBuffer);
			span.Clear();
			ArrayPool<byte>.Shared.Return(rentedBuffer);
		}
	}
	internal static class ThrowHelper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		[DoesNotReturn]
		public static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity)
		{
			throw new OutOfMemoryException(System.SR.Format(System.SR.BufferMaximumSizeExceeded, capacity));
		}
	}
}
namespace Microsoft.Extensions.Logging
{
	[UnsupportedOSPlatform("browser")]
	public static class ConsoleLoggerExtensions
	{
		internal const string RequiresDynamicCodeMessage = "Binding TOptions to configuration values may require generating dynamic code at runtime.";

		internal const string TrimmingRequiresUnreferencedCodeMessage = "TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.";

		[UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "AddConsoleFormatter and RegisterProviderOptions are only called with Options types which only have simple properties.")]
		[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "AddConsoleFormatter and RegisterProviderOptions are only dangerous when the Options type cannot be statically analyzed, but that is not the case here. The DynamicallyAccessedMembers annotations on them will make sure to preserve the right members from the different options objects.")]
		public static ILoggingBuilder AddConsole(this ILoggingBuilder builder)
		{
			LoggingBuilderConfigurationExtensions.AddConfiguration(builder);
			builder.AddConsoleFormatter<JsonConsoleFormatter, JsonConsoleFormatterOptions>();
			builder.AddConsoleFormatter<SystemdConsoleFormatter, ConsoleFormatterOptions>();
			builder.AddConsoleFormatter<SimpleConsoleFormatter, SimpleConsoleFormatterOptions>();
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(builder.Services, ServiceDescriptor.Singleton<ILoggerProvider, ConsoleLoggerProvider>());
			LoggerProviderOptions.RegisterProviderOptions<ConsoleLoggerOptions, ConsoleLoggerProvider>(builder.Services);
			return builder;
		}

		public static ILoggingBuilder AddConsole(this ILoggingBuilder builder, Action<ConsoleLoggerOptions> configure)
		{
			System.ThrowHelper.ThrowIfNull(configure, "configure");
			builder.AddConsole();
			OptionsServiceCollectionExtensions.Configure<ConsoleLoggerOptions>(builder.Services, configure);
			return builder;
		}

		public static ILoggingBuilder AddSimpleConsole(this ILoggingBuilder builder)
		{
			return builder.AddFormatterWithName("simple");
		}

		public static ILoggingBuilder AddSimpleConsole(this ILoggingBuilder builder, Action<SimpleConsoleFormatterOptions> configure)
		{
			return builder.AddConsoleWithFormatter("simple", configure);
		}

		public static ILoggingBuilder AddJsonConsole(this ILoggingBuilder builder)
		{
			return builder.AddFormatterWithName("json");
		}

		public static ILoggingBuilder AddJsonConsole(this ILoggingBuilder builder, Action<JsonConsoleFormatterOptions> configure)
		{
			return builder.AddConsoleWithFormatter("json", configure);
		}

		public static ILoggingBuilder AddSystemdConsole(this ILoggingBuilder builder, Action<ConsoleFormatterOptions> configure)
		{
			return builder.AddConsoleWithFormatter("systemd", configure);
		}

		public static ILoggingBuilder AddSystemdConsole(this ILoggingBuilder builder)
		{
			return builder.AddFormatterWithName("systemd");
		}

		internal static ILoggingBuilder AddConsoleWithFormatter<TOptions>(this ILoggingBuilder builder, string name, Action<TOptions> configure) where TOptions : ConsoleFormatterOptions
		{
			System.ThrowHelper.ThrowIfNull(configure, "configure");
			builder.AddFormatterWithName(name);
			OptionsServiceCollectionExtensions.Configure<TOptions>(builder.Services, configure);
			return builder;
		}

		private static ILoggingBuilder AddFormatterWithName(this ILoggingBuilder builder, string name)
		{
			return builder.AddConsole(delegate(ConsoleLoggerOptions options)
			{
				options.FormatterName = name;
			});
		}

		[RequiresDynamicCode("Binding TOptions to configuration values may require generating dynamic code at runtime.")]
		[RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
		public static ILoggingBuilder AddConsoleFormatter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TFormatter, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TOptions>(this ILoggingBuilder builder) where TFormatter : ConsoleFormatter where TOptions : ConsoleFormatterOptions
		{
			LoggingBuilderConfigurationExtensions.AddConfiguration(builder);
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(builder.Services, ServiceDescriptor.Singleton<ConsoleFormatter, TFormatter>());
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(builder.Services, ServiceDescriptor.Singleton<IConfigureOptions<TOptions>, ConsoleLoggerFormatterConfigureOptions<TFormatter, TOptions>>());
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(builder.Services, ServiceDescriptor.Singleton<IOptionsChangeTokenSource<TOptions>, ConsoleLoggerFormatterOptionsChangeTokenSource<TFormatter, TOptions>>());
			return builder;
		}

		[RequiresDynamicCode("Binding TOptions to configuration values may require generating dynamic code at runtime.")]
		[RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
		public static ILoggingBuilder AddConsoleFormatter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TFormatter, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TOptions>(this ILoggingBuilder builder, Action<TOptions> configure) where TFormatter : ConsoleFormatter where TOptions : ConsoleFormatterOptions
		{
			System.ThrowHelper.ThrowIfNull(configure, "configure");
			builder.AddConsoleFormatter<TFormatter, TOptions>();
			OptionsServiceCollectionExtensions.Configure<TOptions>(builder.Services, configure);
			return builder;
		}
	}
	[UnsupportedOSPlatform("browser")]
	internal sealed class ConsoleLoggerFormatterConfigureOptions<TFormatter, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TOptions> : ConfigureFromConfigurationOptions<TOptions> where TFormatter : ConsoleFormatter where TOptions : ConsoleFormatterOptions
	{
		[RequiresDynamicCode("Binding TOptions to configuration values may require generating dynamic code at runtime.")]
		[RequiresUnreferencedCode("TOptions's dependent types may have their members trimmed. Ensure all required members are preserved.")]
		public ConsoleLoggerFormatterConfigureOptions(ILoggerProviderConfiguration<ConsoleLoggerProvider> providerConfiguration)
		{
			((ConfigureFromConfigurationOptions<?>)(object)this)..ctor((IConfiguration)(object)providerConfiguration.Configuration.GetSection("FormatterOptions"));
		}
	}
	[UnsupportedOSPlatform("browser")]
	internal sealed class ConsoleLoggerFormatterOptionsChangeTokenSource<TFormatter, TOptions> : ConfigurationChangeTokenSource<TOptions> where TFormatter : ConsoleFormatter where TOptions : ConsoleFormatterOptions
	{
		public ConsoleLoggerFormatterOptionsChangeTokenSource(ILoggerProviderConfiguration<ConsoleLoggerProvider> providerConfiguration)
		{
			((ConfigurationChangeTokenSource<?>)(object)this)..ctor((IConfiguration)(object)providerConfiguration.Configuration.GetSection("FormatterOptions"));
		}
	}
	internal sealed class NullExternalScopeProvider : IExternalScopeProvider
	{
		public static IExternalScopeProvider Instance { get; } = (IExternalScopeProvider)(object)new NullExternalScopeProvider();


		private NullExternalScopeProvider()
		{
		}

		void IExternalScopeProvider.ForEachScope<TState>(Action<object, TState> callback, TState state)
		{
		}

		IDisposable IExternalScopeProvider.Push(object state)
		{
			return NullScope.Instance;
		}
	}
	internal sealed class NullScope : IDisposable
	{
		public static NullScope Instance { get; } = new NullScope();


		private NullScope()
		{
		}

		public void Dispose()
		{
		}
	}
}
namespace Microsoft.Extensions.Logging.Console
{
	internal sealed class AnsiLogConsole : IConsole
	{
		private readonly TextWriter _textWriter;

		public AnsiLogConsole(bool stdErr = false)
		{
			_textWriter = (stdErr ? System.Console.Error : System.Console.Out);
		}

		public void Write(string message)
		{
			_textWriter.Write(message);
		}
	}
	internal sealed class AnsiParser
	{
		private readonly Action<string, int, int, ConsoleColor?, ConsoleColor?> _onParseWrite;

		internal const string DefaultForegroundColor = "\u001b[39m\u001b[22m";

		internal const string DefaultBackgroundColor = "\u001b[49m";

		public AnsiParser(Action<string, int, int, ConsoleColor?, ConsoleColor?> onParseWrite)
		{
			System.ThrowHelper.ThrowIfNull(onParseWrite, "onParseWrite");
			_onParseWrite = onParseWrite;
		}

		public void Parse(string message)
		{
			int num = -1;
			int arg = 0;
			ConsoleColor? arg2 = null;
			ConsoleColor? arg3 = null;
			ReadOnlySpan<char> readOnlySpan = message.AsSpan();
			ConsoleColor? color = null;
			bool isBright = false;
			int num2;
			for (num2 = 0; num2 < readOnlySpan.Length; num2++)
			{
				if (readOnlySpan[num2] == '\u001b' && readOnlySpan.Length >= num2 + 4 && readOnlySpan[num2 + 1] == '[')
				{
					if (readOnlySpan[num2 + 3] == 'm')
					{
						if (IsDigit(readOnlySpan[num2 + 2]))
						{
							int num3 = readOnlySpan[num2 + 2] - 48;
							if (num != -1)
							{
								_onParseWrite(message, num, arg, arg3, arg2);
								num = -1;
								arg = 0;
							}
							if (num3 == 1)
							{
								isBright = true;
							}
							num2 += 3;
							continue;
						}
					}
					else if (readOnlySpan.Length >= num2 + 5 && readOnlySpan[num2 + 4] == 'm' && IsDigit(readOnlySpan[num2 + 2]) && IsDigit(readOnlySpan[num2 + 3]))
					{
						int num3 = (readOnlySpan[num2 + 2] - 48) * 10 + (readOnlySpan[num2 + 3] - 48);
						if (num != -1)
						{
							_onParseWrite(message, num, arg, arg3, arg2);
							num = -1;
							arg = 0;
						}
						if (TryGetForegroundColor(num3, isBright, out color))
						{
							arg2 = color;
							isBright = false;
						}
						else if (TryGetBackgroundColor(num3, out color))
						{
							arg3 = color;
						}
						num2 += 4;
						continue;
					}
				}
				if (num == -1)
				{
					num = num2;
				}
				int num4 = -1;
				if (num2 < message.Length - 1)
				{
					num4 = message.IndexOf('\u001b', num2 + 1);
				}
				if (num4 < 0)
				{
					arg = message.Length - num;
					break;
				}
				arg = num4 - num;
				num2 = num4 - 1;
			}
			if (num != -1)
			{
				_onParseWrite(message, num, arg, arg3, arg2);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static bool IsDigit(char c)
		{
			return (uint)(c - 48) <= 9u;
		}

		internal static string GetForegroundColorEscapeCode(ConsoleColor color)
		{
			return color switch
			{
				ConsoleColor.Black => "\u001b[30m", 
				ConsoleColor.DarkRed => "\u001b[31m", 
				ConsoleColor.DarkGreen => "\u001b[32m", 
				ConsoleColor.DarkYellow => "\u001b[33m", 
				ConsoleColor.DarkBlue => "\u001b[34m", 
				ConsoleColor.DarkMagenta => "\u001b[35m", 
				ConsoleColor.DarkCyan => "\u001b[36m", 
				ConsoleColor.Gray => "\u001b[37m", 
				ConsoleColor.Red => "\u001b[1m\u001b[31m", 
				ConsoleColor.Green => "\u001b[1m\u001b[32m", 
				ConsoleColor.Yellow => "\u001b[1m\u001b[33m", 
				ConsoleColor.Blue => "\u001b[1m\u001b[34m", 
				ConsoleColor.Magenta => "\u001b[1m\u001b[35m", 
				ConsoleColor.Cyan => "\u001b[1m\u001b[36m", 
				ConsoleColor.White => "\u001b[1m\u001b[37m", 
				_ => "\u001b[39m\u001b[22m", 
			};
		}

		internal static string GetBackgroundColorEscapeCode(ConsoleColor color)
		{
			return color switch
			{
				ConsoleColor.Black => "\u001b[40m", 
				ConsoleColor.DarkRed => "\u001b[41m", 
				ConsoleColor.DarkGreen => "\u001b[42m", 
				ConsoleColor.DarkYellow => "\u001b[43m", 
				ConsoleColor.DarkBlue => "\u001b[44m", 
				ConsoleColor.DarkMagenta => "\u001b[45m", 
				ConsoleColor.DarkCyan => "\u001b[46m", 
				ConsoleColor.Gray => "\u001b[47m", 
				_ => "\u001b[49m", 
			};
		}

		private static bool TryGetForegroundColor(int number, bool isBright, out ConsoleColor? color)
		{
			color = number switch
			{
				30 => ConsoleColor.Black, 
				31 => isBright ? ConsoleColor.Red : ConsoleColor.DarkRed, 
				32 => isBright ? ConsoleColor.Green : ConsoleColor.DarkGreen, 
				33 => isBright ? ConsoleColor.Yellow : ConsoleColor.DarkYellow, 
				34 => (!isBright) ? ConsoleColor.DarkBlue : ConsoleColor.Blue, 
				35 => isBright ? ConsoleColor.Magenta : ConsoleColor.DarkMagenta, 
				36 => isBright ? ConsoleColor.Cyan : ConsoleColor.DarkCyan, 
				37 => isBright ? ConsoleColor.White : ConsoleColor.Gray, 
				_ => null, 
			};
			if (!color.HasValue)
			{
				return number == 39;
			}
			return true;
		}

		private static bool TryGetBackgroundColor(int number, out ConsoleColor? color)
		{
			color = number switch
			{
				40 => ConsoleColor.Black, 
				41 => ConsoleColor.DarkRed, 
				42 => ConsoleColor.DarkGreen, 
				43 => ConsoleColor.DarkYellow, 
				44 => ConsoleColor.DarkBlue, 
				45 => ConsoleColor.DarkMagenta, 
				46 => ConsoleColor.DarkCyan, 
				47 => ConsoleColor.Gray, 
				_ => null, 
			};
			if (!color.HasValue)
			{
				return number == 49;
			}
			return true;
		}
	}
	[UnsupportedOSPlatform("android")]
	[UnsupportedOSPlatform("browser")]
	[UnsupportedOSPlatform("ios")]
	[UnsupportedOSPlatform("tvos")]
	internal sealed class AnsiParsingLogConsole : IConsole
	{
		private readonly TextWriter _textWriter;

		private readonly AnsiParser _parser;

		public AnsiParsingLogConsole(bool stdErr = false)
		{
			_textWriter = (stdErr ? System.Console.Error : System.Console.Out);
			_parser = new AnsiParser(WriteToConsole);
		}

		public void Write(string message)
		{
			_parser.Parse(message);
		}

		private static bool SetColor(ConsoleColor? background, ConsoleColor? foreground)
		{
			bool flag = SetBackgroundColor(background);
			return SetForegroundColor(foreground) || flag;
		}

		private static bool SetBackgroundColor(ConsoleColor? background)
		{
			if (background.HasValue)
			{
				System.Console.BackgroundColor = background.Value;
				return true;
			}
			return false;
		}

		private static bool SetForegroundColor(ConsoleColor? foreground)
		{
			if (foreground.HasValue)
			{
				System.Console.ForegroundColor = foreground.Value;
				return true;
			}
			return false;
		}

		private static void ResetColor()
		{
			System.Console.ResetColor();
		}

		private void WriteToConsole(string message, int startIndex, int length, ConsoleColor? background, ConsoleColor? foreground)
		{
			ReadOnlySpan<char> readOnlySpan = message.AsSpan(startIndex, length);
			bool flag = SetColor(background, foreground);
			_textWriter.Write(readOnlySpan.ToString());
			if (flag)
			{
				ResetColor();
			}
		}
	}
	public abstract class ConsoleFormatter
	{
		public string Name { get; }

		protected ConsoleFormatter(string name)
		{
			System.ThrowHelper.ThrowIfNull(name, "name");
			Name = name;
		}

		public abstract void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter);
	}
	public static class ConsoleFormatterNames
	{
		public const string Simple = "simple";

		public const string Json = "json";

		public const string Systemd = "systemd";
	}
	public class ConsoleFormatterOptions
	{
		public bool IncludeScopes { get; set; }

		[StringSyntax("DateTimeFormat")]
		public string? TimestampFormat { get; set; }

		public bool UseUtcTimestamp { get; set; }
	}
	[UnsupportedOSPlatform("browser")]
	internal sealed class ConsoleLogger : ILogger
	{
		private readonly string _name;

		private readonly ConsoleLoggerProcessor _queueProcessor;

		[ThreadStatic]
		private static StringWriter t_stringWriter;

		internal ConsoleFormatter Formatter { get; set; }

		internal IExternalScopeProvider? ScopeProvider { get; set; }

		internal ConsoleLoggerOptions Options { get; set; }

		internal ConsoleLogger(string name, ConsoleLoggerProcessor loggerProcessor, ConsoleFormatter formatter, IExternalScopeProvider? scopeProvider, ConsoleLoggerOptions options)
		{
			System.ThrowHelper.ThrowIfNull(name, "name");
			_name = name;
			_queueProcessor = loggerProcessor;
			Formatter = formatter;
			ScopeProvider = scopeProvider;
			Options = options;
		}

		public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if (!IsEnabled(logLevel))
			{
				return;
			}
			System.ThrowHelper.ThrowIfNull(formatter, "formatter");
			if (t_stringWriter == null)
			{
				t_stringWriter = new StringWriter();
			}
			LogEntry<TState> logEntry = default(LogEntry<TState>);
			logEntry..ctor(logLevel, _name, eventId, state, exception, formatter);
			Formatter.Write(in logEntry, ScopeProvider, t_stringWriter);
			StringBuilder stringBuilder = t_stringWriter.GetStringBuilder();
			if (stringBuilder.Length != 0)
			{
				string message = stringBuilder.ToString();
				stringBuilder.Clear();
				if (stringBuilder.Capacity > 1024)
				{
					stringBuilder.Capacity = 1024;
				}
				_queueProcessor.EnqueueMessage(new LogMessageEntry(message, logLevel >= Options.LogToStandardErrorThreshold));
			}
		}

		public bool IsEnabled(LogLevel logLevel)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			return (int)logLevel != 6;
		}

		public IDisposable BeginScope<TState>(TState state) where TState : notnull
		{
			IExternalScopeProvider? scopeProvider = ScopeProvider;
			return ((scopeProvider != null) ? scopeProvider.Push((object)state) : null) ?? NullScope.Instance;
		}
	}
	[Obsolete("ConsoleLoggerFormat has been deprecated.")]
	public enum ConsoleLoggerFormat
	{
		Default,
		Systemd
	}
	public class ConsoleLoggerOptions
	{
		private ConsoleLoggerFormat _format;

		private ConsoleLoggerQueueFullMode _queueFullMode;

		internal const int DefaultMaxQueueLengthValue = 2500;

		private int _maxQueuedMessages = 2500;

		[Obsolete("ConsoleLoggerOptions.DisableColors has been deprecated. Use SimpleConsoleFormatterOptions.ColorBehavior instead.")]
		public bool DisableColors { get; set; }

		[Obsolete("ConsoleLoggerOptions.Format has been deprecated. Use ConsoleLoggerOptions.FormatterName instead.")]
		public ConsoleLoggerFormat Format
		{
			get
			{
				return _format;
			}
			set
			{
				if (value < ConsoleLoggerFormat.Default || value > ConsoleLoggerFormat.Systemd)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_format = value;
			}
		}

		public string? FormatterName { get; set; }

		[Obsolete("ConsoleLoggerOptions.IncludeScopes has been deprecated. Use ConsoleFormatterOptions.IncludeScopes instead.")]
		public bool IncludeScopes { get; set; }

		public LogLevel LogToStandardErrorThreshold { get; set; } = (LogLevel)6;


		[Obsolete("ConsoleLoggerOptions.TimestampFormat has been deprecated. Use ConsoleFormatterOptions.TimestampFormat instead.")]
		public string? TimestampFormat { get; set; }

		[Obsolete("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Use ConsoleFormatterOptions.UseUtcTimestamp instead.")]
		public bool UseUtcTimestamp { get; set; }

		public ConsoleLoggerQueueFullMode QueueFullMode
		{
			get
			{
				return _queueFullMode;
			}
			set
			{
				if (value != 0 && value != ConsoleLoggerQueueFullMode.DropWrite)
				{
					throw new ArgumentOutOfRangeException(System.SR.Format(System.SR.QueueModeNotSupported, "value"));
				}
				_queueFullMode = value;
			}
		}

		public int MaxQueueLength
		{
			get
			{
				return _maxQueuedMessages;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentOutOfRangeException(System.SR.Format(System.SR.MaxQueueLengthBadValue, "value"));
				}
				_maxQueuedMessages = value;
			}
		}
	}
	[UnsupportedOSPlatform("browser")]
	internal class ConsoleLoggerProcessor : IDisposable
	{
		private readonly Queue<LogMessageEntry> _messageQueue;

		private volatile int _messagesDropped;

		private bool _isAddingCompleted;

		private int _maxQueuedMessages = 2500;

		private ConsoleLoggerQueueFullMode _fullMode;

		private readonly Thread _outputThread;

		public int MaxQueueLength
		{
			get
			{
				return _maxQueuedMessages;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentOutOfRangeException(System.SR.Format(System.SR.MaxQueueLengthBadValue, "value"));
				}
				lock (_messageQueue)
				{
					_maxQueuedMessages = value;
					Monitor.PulseAll(_messageQueue);
				}
			}
		}

		public ConsoleLoggerQueueFullMode FullMode
		{
			get
			{
				return _fullMode;
			}
			set
			{
				if (value != 0 && value != ConsoleLoggerQueueFullMode.DropWrite)
				{
					throw new ArgumentOutOfRangeException(System.SR.Format(System.SR.QueueModeNotSupported, "value"));
				}
				lock (_messageQueue)
				{
					_fullMode = value;
					Monitor.PulseAll(_messageQueue);
				}
			}
		}

		public IConsole Console { get; }

		public IConsole ErrorConsole { get; }

		public ConsoleLoggerProcessor(IConsole console, IConsole errorConsole, ConsoleLoggerQueueFullMode fullMode, int maxQueueLength)
		{
			_messageQueue = new Queue<LogMessageEntry>();
			FullMode = fullMode;
			MaxQueueLength = maxQueueLength;
			Console = console;
			ErrorConsole = errorConsole;
			_outputThread = new Thread(ProcessLogQueue)
			{
				IsBackground = true,
				Name = "Console logger queue processing thread"
			};
			_outputThread.Start();
		}

		public virtual void EnqueueMessage(LogMessageEntry message)
		{
			if (!Enqueue(message))
			{
				WriteMessage(message);
			}
		}

		internal void WriteMessage(LogMessageEntry entry)
		{
			try
			{
				IConsole console = (entry.LogAsError ? ErrorConsole : Console);
				console.Write(entry.Message);
			}
			catch
			{
				CompleteAdding();
			}
		}

		private void ProcessLogQueue()
		{
			LogMessageEntry item;
			while (TryDequeue(out item))
			{
				WriteMessage(item);
			}
		}

		public bool Enqueue(LogMessageEntry item)
		{
			lock (_messageQueue)
			{
				while (_messageQueue.Count >= MaxQueueLength && !_isAddingCompleted)
				{
					if (FullMode == ConsoleLoggerQueueFullMode.DropWrite)
					{
						_messagesDropped++;
						return true;
					}
					Monitor.Wait(_messageQueue);
				}
				if (!_isAddingCompleted)
				{
					bool flag = _messageQueue.Count == 0;
					if (_messagesDropped > 0)
					{
						_messageQueue.Enqueue(new LogMessageEntry(System.SR.Format(System.SR.WarningMessageOnDrop + Environment.NewLine, _messagesDropped), logAsError: true));
						_messagesDropped = 0;
					}
					_messageQueue.Enqueue(item);
					if (flag)
					{
						Monitor.PulseAll(_messageQueue);
					}
					return true;
				}
			}
			return false;
		}

		public bool TryDequeue(out LogMessageEntry item)
		{
			lock (_messageQueue)
			{
				while (_messageQueue.Count == 0 && !_isAddingCompleted)
				{
					Monitor.Wait(_messageQueue);
				}
				if (_messageQueue.Count > 0 && !_isAddingCompleted)
				{
					item = _messageQueue.Dequeue();
					if (_messageQueue.Count == MaxQueueLength - 1)
					{
						Monitor.PulseAll(_messageQueue);
					}
					return true;
				}
				item = default(LogMessageEntry);
				return false;
			}
		}

		public void Dispose()
		{
			CompleteAdding();
			try
			{
				_outputThread.Join(1500);
			}
			catch (ThreadStateException)
			{
			}
		}

		private void CompleteAdding()
		{
			lock (_messageQueue)
			{
				_isAddingCompleted = true;
				Monitor.PulseAll(_messageQueue);
			}
		}
	}
	[UnsupportedOSPlatform("browser")]
	[ProviderAlias("Console")]
	public class ConsoleLoggerProvider : ILoggerProvider, IDisposable, ISupportExternalScope
	{
		private readonly IOptionsMonitor<ConsoleLoggerOptions> _options;

		private readonly ConcurrentDictionary<string, ConsoleLogger> _loggers;

		private ConcurrentDictionary<string, ConsoleFormatter> _formatters;

		private readonly ConsoleLoggerProcessor _messageQueue;

		private IDisposable _optionsReloadToken;

		private IExternalScopeProvider _scopeProvider = NullExternalScopeProvider.Instance;

		public ConsoleLoggerProvider(IOptionsMonitor<ConsoleLoggerOptions> options)
			: this(options, Array.Empty<ConsoleFormatter>())
		{
		}

		public ConsoleLoggerProvider(IOptionsMonitor<ConsoleLoggerOptions> options, IEnumerable<ConsoleFormatter>? formatters)
		{
			_options = options;
			_loggers = new ConcurrentDictionary<string, ConsoleLogger>();
			SetFormatters(formatters);
			IConsole console;
			IConsole errorConsole;
			if (DoesConsoleSupportAnsi())
			{
				console = new AnsiLogConsole();
				errorConsole = new AnsiLogConsole(stdErr: true);
			}
			else
			{
				console = new AnsiParsingLogConsole();
				errorConsole = new AnsiParsingLogConsole(stdErr: true);
			}
			_messageQueue = new ConsoleLoggerProcessor(console, errorConsole, options.CurrentValue.QueueFullMode, options.CurrentValue.MaxQueueLength);
			ReloadLoggerOptions(options.CurrentValue);
			_optionsReloadToken = OptionsMonitorExtensions.OnChange<ConsoleLoggerOptions>(_options, (Action<ConsoleLoggerOptions>)ReloadLoggerOptions);
		}

		[UnsupportedOSPlatformGuard("windows")]
		private static bool DoesConsoleSupportAnsi()
		{
			if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
			{
				return true;
			}
			IntPtr stdHandle = global::Interop.Kernel32.GetStdHandle(-11);
			if (!global::Interop.Kernel32.GetConsoleMode(stdHandle, out var mode))
			{
				return false;
			}
			return ((ulong)mode & 4uL) == 4;
		}

		[MemberNotNull("_formatters")]
		private void SetFormatters(IEnumerable<ConsoleFormatter> formatters = null)
		{
			ConcurrentDictionary<string, ConsoleFormatter> concurrentDictionary = new ConcurrentDictionary<string, ConsoleFormatter>(StringComparer.OrdinalIgnoreCase);
			bool flag = false;
			if (formatters != null)
			{
				foreach (ConsoleFormatter formatter in formatters)
				{
					concurrentDictionary.TryAdd(formatter.Name, formatter);
					flag = true;
				}
			}
			if (!flag)
			{
				concurrentDictionary.TryAdd("simple", new SimpleConsoleFormatter((IOptionsMonitor<SimpleConsoleFormatterOptions>)(object)new FormatterOptionsMonitor<SimpleConsoleFormatterOptions>(new SimpleConsoleFormatterOptions())));
				concurrentDictionary.TryAdd("systemd", new SystemdConsoleFormatter((IOptionsMonitor<ConsoleFormatterOptions>)(object)new FormatterOptionsMonitor<ConsoleFormatterOptions>(new ConsoleFormatterOptions())));
				concurrentDictionary.TryAdd("json", new JsonConsoleFormatter((IOptionsMonitor<JsonConsoleFormatterOptions>)(object)new FormatterOptionsMonitor<JsonConsoleFormatterOptions>(new JsonConsoleFormatterOptions())));
			}
			_formatters = concurrentDictionary;
		}

		private void ReloadLoggerOptions(ConsoleLoggerOptions options)
		{
			if (options.FormatterName == null || !_formatters.TryGetValue(options.FormatterName, out var value))
			{
				ConsoleLoggerFormat format = options.Format;
				ConsoleFormatter consoleFormatter = ((format != ConsoleLoggerFormat.Systemd) ? _formatters["simple"] : _formatters["systemd"]);
				value = consoleFormatter;
				if (options.FormatterName == null)
				{
					UpdateFormatterOptions(value, options);
				}
			}
			_messageQueue.FullMode = options.QueueFullMode;
			_messageQueue.MaxQueueLength = options.MaxQueueLength;
			foreach (KeyValuePair<string, ConsoleLogger> logger in _loggers)
			{
				logger.Value.Options = options;
				logger.Value.Formatter = value;
			}
		}

		public ILogger CreateLogger(string name)
		{
			if (_options.CurrentValue.FormatterName == null || !_formatters.TryGetValue(_options.CurrentValue.FormatterName, out var value))
			{
				ConsoleLoggerFormat format = _options.CurrentValue.Format;
				ConsoleFormatter consoleFormatter = ((format != ConsoleLoggerFormat.Systemd) ? _formatters["simple"] : _formatters["systemd"]);
				value = consoleFormatter;
				if (_options.CurrentValue.FormatterName == null)
				{
					UpdateFormatterOptions(value, _options.CurrentValue);
				}
			}
			if (!_loggers.TryGetValue(name, out var value2))
			{
				return (ILogger)(object)_loggers.GetOrAdd(name, new ConsoleLogger(name, _messageQueue, value, _scopeProvider, _options.CurrentValue));
			}
			return (ILogger)(object)value2;
		}

		private static void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions)
		{
			if (formatter is SimpleConsoleFormatter simpleConsoleFormatter)
			{
				simpleConsoleFormatter.FormatterOptions = new SimpleConsoleFormatterOptions
				{
					ColorBehavior = (deprecatedFromOptions.DisableColors ? LoggerColorBehavior.Disabled : LoggerColorBehavior.Default),
					IncludeScopes = deprecatedFromOptions.IncludeScopes,
					TimestampFormat = deprecatedFromOptions.TimestampFormat,
					UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp
				};
			}
			else if (formatter is SystemdConsoleFormatter systemdConsoleFormatter)
			{
				systemdConsoleFormatter.FormatterOptions = new ConsoleFormatterOptions
				{
					IncludeScopes = deprecatedFromOptions.IncludeScopes,
					TimestampFormat = deprecatedFromOptions.TimestampFormat,
					UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp
				};
			}
		}

		public void Dispose()
		{
			_optionsReloadToken?.Dispose();
			_messageQueue.Dispose();
		}

		public void SetScopeProvider(IExternalScopeProvider scopeProvider)
		{
			_scopeProvider = scopeProvider;
			foreach (KeyValuePair<string, ConsoleLogger> logger in _loggers)
			{
				logger.Value.ScopeProvider = _scopeProvider;
			}
		}
	}
	public enum ConsoleLoggerQueueFullMode
	{
		Wait,
		DropWrite
	}
	internal sealed class FormatterOptionsMonitor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TOptions> : IOptionsMonitor<TOptions> where TOptions : ConsoleFormatterOptions
	{
		private TOptions _options;

		public TOptions CurrentValue => _options;

		public FormatterOptionsMonitor(TOptions options)
		{
			_options = options;
		}

		public TOptions Get(string? name)
		{
			return _options;
		}

		public IDisposable? OnChange(Action<TOptions, string> listener)
		{
			return null;
		}
	}
	internal interface IConsole
	{
		void Write(string message);
	}
	internal sealed class JsonConsoleFormatter : ConsoleFormatter, IDisposable
	{
		private IDisposable _optionsReloadToken;

		internal JsonConsoleFormatterOptions FormatterOptions { get; set; }

		public JsonConsoleFormatter(IOptionsMonitor<JsonConsoleFormatterOptions> options)
			: base("json")
		{
			ReloadLoggerOptions(options.CurrentValue);
			_optionsReloadToken = OptionsMonitorExtensions.OnChange<JsonConsoleFormatterOptions>(options, (Action<JsonConsoleFormatterOptions>)ReloadLoggerOptions);
		}

		public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			string text = logEntry.Formatter(logEntry.State, logEntry.Exception);
			if (logEntry.Exception == null && text == null)
			{
				return;
			}
			LogLevel logLevel = logEntry.LogLevel;
			string category = logEntry.Category;
			EventId eventId = logEntry.EventId;
			int id = ((EventId)(ref eventId)).Id;
			Exception exception = logEntry.Exception;
			using (PooledByteBufferWriter pooledByteBufferWriter = new PooledByteBufferWriter(1024))
			{
				Utf8JsonWriter val = new Utf8JsonWriter((IBufferWriter<byte>)pooledByteBufferWriter, FormatterOptions.JsonWriterOptions);
				try
				{
					val.WriteStartObject();
					string timestampFormat = FormatterOptions.TimestampFormat;
					if (timestampFormat != null)
					{
						val.WriteString("Timestamp", (FormatterOptions.UseUtcTimestamp ? DateTimeOffset.UtcNow : DateTimeOffset.Now).ToString(timestampFormat));
					}
					val.WriteNumber("EventId", id);
					val.WriteString("LogLevel", GetLogLevelString(logLevel));
					val.WriteString("Category", category);
					val.WriteString("Message", text);
					if (exception != null)
					{
						string text2 = exception.ToString();
						JsonWriterOptions jsonWriterOptions = FormatterOptions.JsonWriterOptions;
						if (!((JsonWriterOptions)(ref jsonWriterOptions)).Indented)
						{
							text2 = text2.Replace(Environment.NewLine, " ");
						}
						val.WriteString("Exception", text2);
					}
					if (logEntry.State != null)
					{
						val.WriteStartObject("State");
						val.WriteString("Message", logEntry.State.ToString());
						if ((object)logEntry.State is IReadOnlyCollection<KeyValuePair<string, object>> readOnlyCollection)
						{
							foreach (KeyValuePair<string, object> item in readOnlyCollection)
							{
								WriteItem(val, item);
							}
						}
						val.WriteEndObject();
					}
					WriteScopeInformation(val, scopeProvider);
					val.WriteEndObject();
					val.Flush();
				}
				finally
				{
					((IDisposable)val)?.Dispose();
				}
				textWriter.Write(Encoding.UTF8.GetString(pooledByteBufferWriter.WrittenMemory.Span.ToArray()));
			}
			textWriter.Write(Environment.NewLine);
		}

		private static string GetLogLevelString(LogLevel logLevel)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected I4, but got Unknown
			return (int)logLevel switch
			{
				0 => "Trace", 
				1 => "Debug", 
				2 => "Information", 
				3 => "Warning", 
				4 => "Error", 
				5 => "Critical", 
				_ => throw new ArgumentOutOfRangeException("logLevel"), 
			};
		}

		private void WriteScopeInformation(Utf8JsonWriter writer, IExternalScopeProvider scopeProvider)
		{
			if (!FormatterOptions.IncludeScopes || scopeProvider == null)
			{
				return;
			}
			writer.WriteStartArray("Scopes");
			scopeProvider.ForEachScope<Utf8JsonWriter>((Action<object, Utf8JsonWriter>)delegate(object scope, Utf8JsonWriter state)
			{
				if (scope is IEnumerable<KeyValuePair<string, object>> enumerable)
				{
					state.WriteStartObject();
					state.WriteString("Message", scope.ToString());
					foreach (KeyValuePair<string, object> item in enumerable)
					{
						WriteItem(state, item);
					}
					state.WriteEndObject();
				}
				else
				{
					state.WriteStringValue(ToInvariantString(scope));
				}
			}, writer);
			writer.WriteEndArray();
		}

		private static void WriteItem(Utf8JsonWriter writer, KeyValuePair<string, object> item)
		{
			string key = item.Key;
			object value = item.Value;
			if (!(value is bool flag))
			{
				if (!(value is byte b))
				{
					if (!(value is sbyte b2))
					{
						if (!(value is char c))
						{
							if (!(value is decimal num))
							{
								if (!(value is double num2))
								{
									if (!(value is float num3))
									{
										if (!(value is int num4))
										{
											if (!(value is uint num5))
											{
												if (!(value is long num6))
												{
													if (!(value is ulong num7))
													{
														if (!(value is short num8))
														{
															if (!(value is ushort num9))
															{
																if (value == null)
																{
																	writer.WriteNull(key);
																}
																else
																{
																	writer.WriteString(key, ToInvariantString(item.Value));
																}
															}
															else
															{
																writer.WriteNumber(key, (int)num9);
															}
														}
														else
														{
															writer.WriteNumber(key, (int)num8);
														}
													}
													else
													{
														writer.WriteNumber(key, num7);
													}
												}
												else
												{
													writer.WriteNumber(key, num6);
												}
											}
											else
											{
												writer.WriteNumber(key, num5);
											}
										}
										else
										{
											writer.WriteNumber(key, num4);
										}
									}
									else
									{
										writer.WriteNumber(key, num3);
									}
								}
								else
								{
									writer.WriteNumber(key, num2);
								}
							}
							else
							{
								writer.WriteNumber(key, num);
							}
						}
						else
						{
							writer.WriteString(key, c.ToString());
						}
					}
					else
					{
						writer.WriteNumber(key, (int)b2);
					}
				}
				else
				{
					writer.WriteNumber(key, (int)b);
				}
			}
			else
			{
				writer.WriteBoolean(key, flag);
			}
		}

		private static string ToInvariantString(object obj)
		{
			return Convert.ToString(obj, CultureInfo.InvariantCulture);
		}

		[MemberNotNull("FormatterOptions")]
		private void ReloadLoggerOptions(JsonConsoleFormatterOptions options)
		{
			FormatterOptions = options;
		}

		public void Dispose()
		{
			_optionsReloadToken?.Dispose();
		}
	}
	public class JsonConsoleFormatterOptions : ConsoleFormatterOptions
	{
		public JsonWriterOptions JsonWriterOptions { get; set; }
	}
	public enum LoggerColorBehavior
	{
		Default,
		Enabled,
		Disabled
	}
	internal readonly struct LogMessageEntry
	{
		public readonly string Message;

		public readonly bool LogAsError;

		public LogMessageEntry(string message, bool logAsError = false)
		{
			Message = message;
			LogAsError = logAsError;
		}
	}
	internal sealed class SimpleConsoleFormatter : ConsoleFormatter, IDisposable
	{
		private readonly struct ConsoleColors
		{
			public ConsoleColor? Foreground { get; }

			public ConsoleColor? Background { get; }

			public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background)
			{
				Foreground = foreground;
				Background = background;
			}
		}

		private const string LoglevelPadding = ": ";

		private static readonly string _messagePadding = new string(' ', GetLogLevelString((LogLevel)2).Length + ": ".Length);

		private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding;

		private IDisposable _optionsReloadToken;

		internal SimpleConsoleFormatterOptions FormatterOptions { get; set; }

		public SimpleConsoleFormatter(IOptionsMonitor<SimpleConsoleFormatterOptions> options)
			: base("simple")
		{
			ReloadLoggerOptions(options.CurrentValue);
			_optionsReloadToken = OptionsMonitorExtensions.OnChange<SimpleConsoleFormatterOptions>(options, (Action<SimpleConsoleFormatterOptions>)ReloadLoggerOptions);
		}

		[MemberNotNull("FormatterOptions")]
		private void ReloadLoggerOptions(SimpleConsoleFormatterOptions options)
		{
			FormatterOptions = options;
		}

		public void Dispose()
		{
			_optionsReloadToken?.Dispose();
		}

		public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			string text = logEntry.Formatter(logEntry.State, logEntry.Exception);
			if (logEntry.Exception != null || text != null)
			{
				LogLevel logLevel = logEntry.LogLevel;
				ConsoleColors logLevelConsoleColors = GetLogLevelConsoleColors(logLevel);
				string logLevelString = GetLogLevelString(logLevel);
				string text2 = null;
				string timestampFormat = FormatterOptions.TimestampFormat;
				if (timestampFormat != null)
				{
					text2 = GetCurrentDateTime().ToString(timestampFormat);
				}
				if (text2 != null)
				{
					textWriter.Write(text2);
				}
				if (logLevelString != null)
				{
					textWriter.WriteColoredMessage(logLevelString, logLevelConsoleColors.Background, logLevelConsoleColors.Foreground);
				}
				CreateDefaultLogMessage(textWriter, in logEntry, text, scopeProvider);
			}
		}

		private void CreateDefaultLogMessage<TState>(TextWriter textWriter, in LogEntry<TState> logEntry, string message, IExternalScopeProvider scopeProvider)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			bool singleLine = FormatterOptions.SingleLine;
			EventId eventId = logEntry.EventId;
			int id = ((EventId)(ref eventId)).Id;
			Exception exception = logEntry.Exception;
			textWriter.Write(": ");
			textWriter.Write(logEntry.Category);
			textWriter.Write('[');
			textWriter.Write(id.ToString());
			textWriter.Write(']');
			if (!singleLine)
			{
				textWriter.Write(Environment.NewLine);
			}
			WriteScopeInformation(textWriter, scopeProvider, singleLine);
			WriteMessage(textWriter, message, singleLine);
			if (exception != null)
			{
				WriteMessage(textWriter, exception.ToString(), singleLine);
			}
			if (singleLine)
			{
				textWriter.Write(Environment.NewLine);
			}
		}

		private static void WriteMessage(TextWriter textWriter, string message, bool singleLine)
		{
			if (!string.IsNullOrEmpty(message))
			{
				if (singleLine)
				{
					textWriter.Write(' ');
					WriteReplacing(textWriter, Environment.NewLine, " ", message);
				}
				else
				{
					textWriter.Write(_messagePadding);
					WriteReplacing(textWriter, Environment.NewLine, _newLineWithMessagePadding, message);
					textWriter.Write(Environment.NewLine);
				}
			}
			static void WriteReplacing(TextWriter writer, string oldValue, string newValue, string message)
			{
				string value = message.Replace(oldValue, newValue);
				writer.Write(value);
			}
		}

		private DateTimeOffset GetCurrentDateTime()
		{
			if (!FormatterOptions.UseUtcTimestamp)
			{
				return DateTimeOffset.Now;
			}
			return DateTimeOffset.UtcNow;
		}

		private static string GetLogLevelString(LogLevel logLevel)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected I4, but got Unknown
			return (int)logLevel switch
			{
				0 => "trce", 
				1 => "dbug", 
				2 => "info", 
				3 => "warn", 
				4 => "fail", 
				5 => "crit", 
				_ => throw new ArgumentOutOfRangeException("logLevel"), 
			};
		}

		private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected I4, but got Unknown
			if (FormatterOptions.ColorBehavior == LoggerColorBehavior.Disabled || (FormatterOptions.ColorBehavior == LoggerColorBehavior.Default && !ConsoleUtils.EmitAnsiColorCodes))
			{
				return new ConsoleColors(null, null);
			}
			return (int)logLevel switch
			{
				0 => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black), 
				1 => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black), 
				2 => new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black), 
				3 => new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black), 
				4 => new ConsoleColors(ConsoleColor.Black, ConsoleColor.DarkRed), 
				5 => new ConsoleColors(ConsoleColor.White, ConsoleColor.DarkRed), 
				_ => new ConsoleColors(null, null), 
			};
		}

		private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider, bool singleLine)
		{
			if (!FormatterOptions.IncludeScopes || scopeProvider == null)
			{
				return;
			}
			bool paddingNeeded = !singleLine;
			scopeProvider.ForEachScope<TextWriter>((Action<object, TextWriter>)delegate(object scope, TextWriter state)
			{
				if (paddingNeeded)
				{
					paddingNeeded = false;
					state.Write(_messagePadding);
					state.Write("=> ");
				}
				else
				{
					state.Write(" => ");
				}
				state.Write(scope);
			}, textWriter);
			if (!paddingNeeded && !singleLine)
			{
				textWriter.Write(Environment.NewLine);
			}
		}
	}
	public class SimpleConsoleFormatterOptions : ConsoleFormatterOptions
	{
		public LoggerColorBehavior ColorBehavior { get; set; }

		public bool SingleLine { get; set; }
	}
	internal sealed class SystemdConsoleFormatter : ConsoleFormatter, IDisposable
	{
		private IDisposable _optionsReloadToken;

		internal ConsoleFormatterOptions FormatterOptions { get; set; }

		public SystemdConsoleFormatter(IOptionsMonitor<ConsoleFormatterOptions> options)
			: base("systemd")
		{
			ReloadLoggerOptions(options.CurrentValue);
			_optionsReloadToken = OptionsMonitorExtensions.OnChange<ConsoleFormatterOptions>(options, (Action<ConsoleFormatterOptions>)ReloadLoggerOptions);
		}

		[MemberNotNull("FormatterOptions")]
		private void ReloadLoggerOptions(ConsoleFormatterOptions options)
		{
			FormatterOptions = options;
		}

		public void Dispose()
		{
			_optionsReloadToken?.Dispose();
		}

		public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			string text = logEntry.Formatter(logEntry.State, logEntry.Exception);
			if (logEntry.Exception != null || text != null)
			{
				LogLevel logLevel = logEntry.LogLevel;
				string category = logEntry.Category;
				EventId eventId = logEntry.EventId;
				int id = ((EventId)(ref eventId)).Id;
				Exception exception = logEntry.Exception;
				string syslogSeverityString = GetSyslogSeverityString(logLevel);
				textWriter.Write(syslogSeverityString);
				string timestampFormat = FormatterOptions.TimestampFormat;
				if (timestampFormat != null)
				{
					textWriter.Write(GetCurrentDateTime().ToString(timestampFormat));
				}
				textWriter.Write(category);
				textWriter.Write('[');
				textWriter.Write(id);
				textWriter.Write(']');
				WriteScopeInformation(textWriter, scopeProvider);
				if (!string.IsNullOrEmpty(text))
				{
					textWriter.Write(' ');
					WriteReplacingNewLine(textWriter, text);
				}
				if (exception != null)
				{
					textWriter.Write(' ');
					WriteReplacingNewLine(textWriter, exception.ToString());
				}
				textWriter.Write(Environment.NewLine);
			}
			static void WriteReplacingNewLine(TextWriter writer, string message)
			{
				string value = message.Replace(Environment.NewLine, " ");
				writer.Write(value);
			}
		}

		private DateTimeOffset GetCurrentDateTime()
		{
			if (!FormatterOptions.UseUtcTimestamp)
			{
				return DateTimeOffset.Now;
			}
			return DateTimeOffset.UtcNow;
		}

		private static string GetSyslogSeverityString(LogLevel logLevel)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected I4, but got Unknown
			return (int)logLevel switch
			{
				0 => "<7>", 
				1 => "<7>", 
				2 => "<6>", 
				3 => "<4>", 
				4 => "<3>", 
				5 => "<2>", 
				_ => throw new ArgumentOutOfRangeException("logLevel"), 
			};
		}

		private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider)
		{
			if (FormatterOptions.IncludeScopes && scopeProvider != null)
			{
				scopeProvider.ForEachScope<TextWriter>((Action<object, TextWriter>)delegate(object scope, TextWriter state)
				{
					state.Write(" => ");
					state.Write(scope);
				}, textWriter);
			}
		}
	}
	internal static class TextWriterExtensions
	{
		public static void WriteColoredMessage(this TextWriter textWriter, string message, ConsoleColor? background, ConsoleColor? foreground)
		{
			if (background.HasValue)
			{
				textWriter.Write(AnsiParser.GetBackgroundColorEscapeCode(background.Value));
			}
			if (foreground.HasValue)
			{
				textWriter.Write(AnsiParser.GetForegroundColorEscapeCode(foreground.Value));
			}
			textWriter.Write(message);
			if (foreground.HasValue)
			{
				textWriter.Write("\u001b[39m\u001b[22m");
			}
			if (background.HasValue)
			{
				textWriter.Write("\u001b[49m");
			}
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Logging.Debug.dll

Decompiled a year ago
#define DEBUG
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging.Debug;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Logging.Debug")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Debug output logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a debugger monitor by writing messages with System.Diagnostics.Debug.WriteLine().")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Debug")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class CallerArgumentExpressionAttribute : Attribute
	{
		public string ParameterName { get; }

		public CallerArgumentExpressionAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
}
namespace Microsoft.Extensions.Logging
{
	public static class DebugLoggerFactoryExtensions
	{
		public static ILoggingBuilder AddDebug(this ILoggingBuilder builder)
		{
			ServiceCollectionDescriptorExtensions.TryAddEnumerable(builder.Services, ServiceDescriptor.Singleton<ILoggerProvider, DebugLoggerProvider>());
			return builder;
		}
	}
	internal sealed class NullExternalScopeProvider : IExternalScopeProvider
	{
		public static IExternalScopeProvider Instance { get; } = (IExternalScopeProvider)(object)new NullExternalScopeProvider();


		private NullExternalScopeProvider()
		{
		}

		void IExternalScopeProvider.ForEachScope<TState>(Action<object, TState> callback, TState state)
		{
		}

		IDisposable IExternalScopeProvider.Push(object state)
		{
			return NullScope.Instance;
		}
	}
	internal sealed class NullScope : IDisposable
	{
		public static NullScope Instance { get; } = new NullScope();


		private NullScope()
		{
		}

		public void Dispose()
		{
		}
	}
}
namespace Microsoft.Extensions.Logging.Debug
{
	internal sealed class DebugLogger : ILogger
	{
		private readonly string _name;

		public DebugLogger(string name)
		{
			_name = name;
		}

		public IDisposable BeginScope<TState>(TState state)
		{
			return NullScope.Instance;
		}

		public bool IsEnabled(LogLevel logLevel)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			if (Debugger.IsAttached)
			{
				return (int)logLevel != 6;
			}
			return false;
		}

		public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (!IsEnabled(logLevel))
			{
				return;
			}
			System.ThrowHelper.ThrowIfNull(formatter, "formatter");
			string text = formatter(state, exception);
			if (!string.IsNullOrEmpty(text))
			{
				text = $"{logLevel}: {text}";
				if (exception != null)
				{
					text = text + Environment.NewLine + Environment.NewLine + exception;
				}
				DebugWriteLine(text, _name);
			}
		}

		private static void DebugWriteLine(string message, string name)
		{
			System.Diagnostics.Debug.WriteLine(message, name);
		}
	}
	[ProviderAlias("Debug")]
	public class DebugLoggerProvider : ILoggerProvider, IDisposable
	{
		public ILogger CreateLogger(string name)
		{
			return (ILogger)(object)new DebugLogger(name);
		}

		public void Dispose()
		{
		}
	}
}

BepInEx/plugins/SlopCrew.Plugin/Microsoft.Extensions.Logging.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using FxResources.Microsoft.Extensions.Logging;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Extensions.Logging")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Logging infrastructure default implementation for Microsoft.Extensions.Logging.")]
[assembly: AssemblyFileVersion("7.0.22.51805")]
[assembly: AssemblyInformationalVersion("7.0.0+d099f075e45d2aa6007a22b71b45a08758559f80")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("7.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.Microsoft.Extensions.Logging
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowIfNull(object argument, [CallerArgumentExpression("argument")] string paramName = null)
		{
			if (argument == null)
			{
				Throw(paramName);
			}
		}

		private static void Throw(string paramName)
		{
			throw new ArgumentNullException(paramName);
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string InvalidActivityTrackingOptions => GetResourceString("InvalidActivityTrackingOptions");

		internal static string MoreThanOneWildcard => GetResourceString("MoreThanOneWildcard");

		private static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		internal static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNul