question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omnisharp won't start or generate assets in vs code mac m1

See original GitHub issue

Environment data

dotnet --info output: .NET SDK (reflecting any global.json): Version: 5.0.405 Commit: 63325e1c7d

Runtime Environment: OS Name: Mac OS X OS Version: 12.2 OS Platform: Darwin RID: osx-x64 Base Path: /usr/local/share/dotnet/x64/sdk/5.0.405/

Host (useful for support): Version: 5.0.14 Commit: d5b56c6327

.NET SDKs installed: 3.1.416 [/usr/local/share/dotnet/x64/sdk] 5.0.405 [/usr/local/share/dotnet/x64/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.22 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.14 [/usr/local/share/dotnet/x64/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.22 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.14 [/usr/local/share/dotnet/x64/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download VS Code version: 1.65.2 C# Extension version: v1.3.1

OmniSharp log

Starting OmniSharp server at 3/29/2022, 12:21:47 PM Target: /Users/gbubemismith/Documents/coreApps/HardCore

OmniSharp server started. Path: /Users/gbubemismith/.vscode/extensions/ms-dotnettools.csharp-1.24.1/.omnisharp/1.38.3-beta.31/run PID: 12046

System.TypeInitializationException: The type initializer for ‘System.ComponentModel.TypeDescriptor’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘Sys’ threw an exception. —> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null) at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag() at Interop+Sys…cctor () [0x00000] in <36514b14425c4337b446653c547aa9c3>:0 — End of inner exception stack trace — at Interop.GetRandomBytes (System.Byte* buffer, System.Int32 length) [0x00000] in <36514b14425c4337b446653c547aa9c3>:0 at System.Guid.NewGuid () [0x00000] in <36514b14425c4337b446653c547aa9c3>:0 at System.ComponentModel.TypeDescriptor…cctor () [0x00034] in <4f55bbf82f9b4c60960312888c59bd5c>:0 — End of inner exception stack trace — at OmniSharp.Internal.CommandOptionExtensions.GetValueOrDefault[T] (McMaster.Extensions.CommandLineUtils.CommandOption opt, T defaultValue) [0x00008] in <b81453133ee74092816142afbffb5d49>:0 at OmniSharp.Stdio.StdioCommandLineApplication.get_Encoding () [0x00000] in <ff89c28654c64c08be0af235972b4254>:0 at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x00000] in <4061e52126604f67b6d455853ab7baf7>:0 at OmniSharp.CommandLineApplication+<>c__DisplayClass12_0.<OnExecute>b__0 () [0x0000b] in <b81453133ee74092816142afbffb5d49>:0 at McMaster.Extensions.CommandLineUtils.CommandLineApplication+<>c__DisplayClass146_0.<OnExecute>b__0 (System.Threading.CancellationToken _) [0x00000] in <abe0fc6797a94a73931eea5cecaffd78>:0 at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync (System.String[] args, System.Threading.CancellationToken cancellationToken) [0x000bf] in <abe0fc6797a94a73931eea5cecaffd78>:0 at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00016] in <abe0fc6797a94a73931eea5cecaffd78>:0 at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <b81453133ee74092816142afbffb5d49>:0 at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <4061e52126604f67b6d455853ab7baf7>:0 at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <b81453133ee74092816142afbffb5d49>:0

Steps to reproduce

Try generating .net assets for build and debug

Expected behavior

.vscode is created and I cand run and debug my .net application

Actual behavior

I get System.TypeInitializationException: The type initializer for ‘System.ComponentModel.TypeDescriptor’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘Sys’ threw an exception. —> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
carlosxupcommented, Aug 13, 2022

Just in case some one else has this problem in Mac M1 Monterrey: I had my CLI pointing to x64 versions so I downloaded the arm64 version but CLI did not even displayed it. So I needed to delete my symlink (it was pointing to x64 versions) $ sudo rm /usr/local/bin/dotnet and then I needed to create it in the right way: $ sudo ln -s /usr/local/share/dotnet /usr/local/bin/

1reaction
UcheIgbokwecommented, Apr 7, 2022

@JoeRobich Just switched to the arm64 build and it works fine on vscode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to generate assets to build and debug. OmniSharp ...
The code I'm trying to generate the assets for build and debug does run, so I'm uncertain where else I should look for...
Read more >
Vscode ... Unable to generate assets to build and debug ...
I received this error "Unable to generate assets to build and debug. OmniSharp server is not running." So any help please?
Read more >
Unable to generate assets to build and debug ... - Reddit
I've just started to try and code and while trying to "Generate assets for build and debug" this message: Unable to generate assets...
Read more >
Unity on Apple silicon and Big Sur: Known issues and ...
The Rosetta emulation on my m1 mac mini runs pretty decent by just using ... VS Code Insiders doesn't work correctly with Omnisharp...
Read more >
omnisharp-vscode - Discover .NET
Support for project.json and csproj projects on Windows, macOS and Linux. The C# extension is powered by OmniSharp. Requirements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found