1

I am running Mac OS Catalina, and have Visual Studio version 8.3.8 installed. Before installing Catalina I had no problems building and running my code in Visual Studio.

I don't get any errors when building the code, but each time I try to run my code I get the following dialog popup

Could not connect to the debugger

And I get the following in my terminal:

bash: /Library/Frameworks/Mono.framework/Versions/6.4.0/bin/mono32: Bad CPU type in executable

I suspect that Catalina doesn't run 32 bit programs, is there a way around this? I thought that Mono from version 5.2 defaulted to 64 bit.

halfer
  • 19,824
  • 17
  • 99
  • 186
user2371684
  • 1,475
  • 5
  • 20
  • 45

2 Answers2

0

I ran into this issue while using the following settings:

Windows 10

  • Visual Studio 2019

Macbook Pro

  • macOS Big Sure 11.4
  • Visual Studio for Mac (latest)
  • XCode 12.5

When trying to debug my Xamarin app for IOS and connect my mac in visual studio I had to follow the following steps.

  1. Install mono - https://www.mono-project.com/docs/about-mono/supported-platforms/macos/
  2. Open Visual Studio for Mac (on mac)
  3. Open XCode (mac)
  4. Connect To mac through Visual Studio

After that I stopped getting the connection error.

I know this isn't your exact question, but maybe it can help someone in the future.

rsnyder
  • 383
  • 1
  • 6
  • 19
0

I experienced the same problem when trying to debug practically any app in VS Mac. I am now using 2022 and the same issue persisted since using 2019. If trying to debug your code locally, what you can do is to run your app first without debugging. Then, attach the debugger to the executed process. So, if your web app is executing in let's say, "Chrome", then search for that process, usually, it will be the name of your app (it's a dotnet process), then simply attach the debugger to it. Then, you should be able to set breakpoints and hit them.

Hope this will help anyone working with VS for Mac.

Janou
  • 125
  • 1
  • 9