Getting System.TypeInitializationException on OSX
See original GitHub issueI don’t know how to reproduce this. On my machine, using either stage0 or stage1/2 gives me the following exception:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Extensions.PlatformAbstractions.PlatformServices' threw an exception.
---> System.PlatformNotSupportedException: Error reading Darwin Kernel Version
---> System.DllNotFoundException: Unable to load DLL 'libc': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Microsoft.Extensions.PlatformAbstractions.Native.NativeMethods.Darwin.sysctl(Int32* name, UInt32 namelen, Byte* oldp, UInt32* oldlenp, IntPtr newp, UInt32 newlen)
at Microsoft.Extensions.PlatformAbstractions.Native.NativeMethods.Darwin.GetKernelRelease()
--- End of inner exception stack trace ---
at Microsoft.Extensions.PlatformAbstractions.Native.NativeMethods.Darwin.GetKernelRelease()
at Microsoft.Extensions.PlatformAbstractions.Native.PlatformApis.GetDarwinVersion()
at Microsoft.Extensions.PlatformAbstractions.Native.PlatformApis.GetOSVersion()
at Microsoft.Extensions.PlatformAbstractions.DefaultRuntimeEnvironment..ctor()
at Microsoft.Extensions.PlatformAbstractions.DefaultPlatformServices..ctor()
at Microsoft.Extensions.PlatformAbstractions.PlatformServices..cctor()
--- End of inner exception stack trace ---
at Microsoft.Extensions.PlatformAbstractions.PlatformServices.get_Default()
at Microsoft.DotNet.Cli.Telemetry..ctor()
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Abort trap: 6
uname -a
Darwin miac 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
OSX 10.11.4
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Mac OS: Unhandled Exception: System. ...
TypeInitializationException: The type initializer for 'Crypto' threw an exception. ---> System.TypeInitializationException: The type initializer ...
Read more >dotnet core in macOS: "The type initializer for 'Crypto' threw ...
Any idea how to install those? mymac:~ naveen.vijay$ dotnet new Unhandled Exception: System.TypeInitializationException: The ...
Read more >TypeInitializationException:The type initializer for 'Gdip ...
I'm building an application that runs on both windows and macos. This application converts dng to bmp. On Windows (10) it works but...
Read more >Why i am getting TypeInitializationException - Microsoft Q&A
System.TypeInitializationException: The type initializer for 'Microsoft.Maui.Controls.Shapes.Shape' threw an exception. ---> System.
Read more >Maperitive won't open on my Mac: Unhandled Exception
Try these steps: Install Mono Framework via Homebrew's Cask: brew cask install mono-mdk. After this step you should have the Mono Framework ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Problem solved. …
I had the following three items in my ~/.bash_profile file:
After commenting those out, stuff works. No idea what tool wrote those lines there, I’ll see if anything else starts breaking all of the sudden 😃
@ballance Look into your
~/.bash_profile
for anything odd, maybe relating to C libraries. The nuclear option would be to back it up and try a vanilla one.