简体   繁体   English

我只是无法让 Visual Studio for Mac 调试工作(该选项显示为灰色)

[英]I just can't get the Visual Studio for Mac debugging to work (the option is greyed out)

no idea what I'm doing wrong here.不知道我在这里做错了什么。 I have two macs at home, one is mine, one is a work laptop.我家里有两台mac,一台是我的,一台是工作笔记本电脑。 I have VS 2022 Preview installed on both, and .net 6 on both.我在两者上都安装了 VS 2022 Preview,并在两者上都安装了 .net 6。 On my home mac, if I start a new c# Console app I'm able to just stick a break point on the (single) Console.Writeline line, hit debug, and it stops on that line as you'd expect.在我的家用 Mac 上,如果我启动一个新的 c# Console 应用程序,我可以在(单个)Console.Writeline 行上放置一个断点,点击调试,它会如您所愿地停在该行上。 On my work mac, breakpoints just turn hollow immediately, and debugging the code just runs the code instead.在我的工作 mac 上,断点立即变成空心的,而调试代码只是运行代码。 The "Start Debugging" option is just greyed out in the menu bar. “开始调试”选项在菜单栏中显示为灰色。 I've tried a bunch of things but I just can't work out why this isn't working!我已经尝试了很多东西,但我就是不知道为什么这不起作用!

I had the same issue and all the other solutions I found did not work for me with VS 2022 (v17.0.6), dotnet6.我遇到了同样的问题,我发现的所有其他解决方案都不适用于 VS 2022 (v17.0.6),dotnet6。

It appears it is an IDE Issue and hopefully gets fixed soon.看来这是一个 IDE 问题,希望很快得到修复。 Installing Visual Studio 2019 seems to solve it.安装 Visual Studio 2019 似乎可以解决它。 Credit here: Visual Studio For Mac 2022 - Cannot execute "{...}.exe" .信用在这里: Visual Studio For Mac 2022 - 无法执行 "{...}.exe"

Out of curiosity, the following appears too 'reset' it back to normal.出于好奇,以下似乎太“重置”它恢复正常。

  1. Set a breakpoint in your code ( mine was hollow when doing so )在你的代码中设置一个断点(我这样做的时候是空心的)
  2. Select 'Visual Studio' -> 'Quit'选择“Visual Studio”->“退出”
  3. Re-open your solution and navigate back to your breakpoint重新打开您的解决方案并导航回您的断点

But after selecting "Start Debugging" option, it returns back to its previous state of no debugging.但是在选择“开始调试”选项后,它又回到了之前没有调试的状态。

I have had the same problem.我曾经也有过一样的问题。 The extension ".Net Core Debugger" was disabled and therefore I was not able to debug projects.扩展“.Net Core Debugger”被禁用,因此我无法调试项目。

Go to Visual Studio -> Extensions -> Installed and check the state转到 Visual Studio -> 扩展 -> 已安装并检查状态

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM