0

When creating a new console application (.Net core) in Visual Studio for Mac and I try to debug it, I get an error:

Debugger operation failed

Unable to start debugging. The type initializer for 'Crypto' threw an exception.

This happens after updating the application to the latest stable release of .Net core 1.1.0.

Any ideas why this might happen?

Lex Li
  • 60,503
  • 9
  • 116
  • 147
linkerro
  • 5,318
  • 3
  • 25
  • 29
  • Does the application run on the command line if you use `dotnet run`? – Nate Barbettini Dec 20 '16 at 15:25
  • The error indicates that openssl is not installed or linked correctly. The instructions for the install on the Mac have been updated from the original at https://www.microsoft.com/net/core#macos – John Davidson Dec 20 '16 at 21:54
  • @NateBarbettini yes it does – linkerro Dec 22 '16 at 20:37
  • @JohnDavidson those were the instructions I used to install it. The error is displayed by Visual Studio, not the app. The app runs fine if started. Also, on some apps debugging works, on others it doesn't. I haven't yet been able to tell exactly what the difference is between apps that can be debugged and apps that can't. – linkerro Dec 22 '16 at 20:39

3 Answers3

0

Try to do the following (found here ):

brew update
brew install openssl
brew link --force openssl

Update: I have faced with the same problem after updating mono via brew. And repeating last steps from Install pre-requisites section helps...

mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Set
  • 47,577
  • 22
  • 132
  • 150
  • Tried it before posting. It solved the problems with the applications not starting, but it didn't fix the problems with Visual Studio. – linkerro Dec 23 '16 at 21:13
0

I had this problem in September/October, with Rider everything always worked. I reported this bug on Xamarin bugzilla and immediately somebody contacted me and "we solved" (I let him working on my machine with TeamViewer).

enter image description here

The working version (7.4) is still not stable but it will be soon.

enter image description here

Mauro Piccotti
  • 1,807
  • 2
  • 23
  • 34
0

Check to make sure this location is set correctly: enter image description here

Eric Milliot-Martinez
  • 4,076
  • 3
  • 23
  • 28