public PlatformBinding()

in aws-crt/CRT.cs [112:159]


            public PlatformBinding()
            {
                string libraryName = null;
                string arch = (Is64Bit) ? (IsAarch64() ? "ARM64" : "x64") : "x86";
                PlatformOS os = Aws.Crt.Platform.GetRuntimePlatformOS();

                switch(os) {
                    case PlatformOS.WINDOWS:
                        libraryName = $"aws-crt-dotnet-{arch}.dll";
                        break;

                    case PlatformOS.UNIX:
                        libraryName = $"libaws-crt-dotnet-{arch}.so";
                        break;

                    case PlatformOS.MAC:
                        libraryName = $"libaws-crt-dotnet-{arch}.dylib";
                        break;
                }

                try
                {
                    libraryPath = ExtractLibrary(libraryName);

                    // Work around virus scanners munching on a newly found DLL
                    int tries = 0;
                    do
                    {
                        crt = CRT.Loader.LoadLibrary(libraryPath);
                        if (crt.IsInvalid)
                        {
                            Thread.Sleep(10);
                        }
                    } while (crt.IsInvalid && tries++ < 100);

                    if (crt.IsInvalid)
                    {
                        string error = CRT.Loader.GetLastError();
                        throw new InvalidOperationException($"Unable to load {libraryPath}: error={error}");
                    }
                }
                catch (Exception ex)
                {
                    throw new InvalidOperationException($"Unable to load {libraryPath}, exception occurred", ex);
                }

                Init();
            }