简体   繁体   English

尽管安装了扩展,为什么我无法在 Visual Studio Code 中调试 C# 代码?

[英]Why can't I debug C# code in Visual Studio Code despite installing extensions?

I try to debug easy C# Hello World code, I followed the guide by Microsoft https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code .我尝试调试简单的 C# Hello World 代码,我按照 Microsoft https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code的指南进行操作。 I can run code via Terminal dotnet run but I can't debug.我可以通过终端 dotnet run 运行代码,但无法调试。

I got error我有错误

"You have any extension for debugging C#" “你有调试 C# 的任何扩展”

but I have "C# for Visual Studio Code (powered by OmniSharp)" and I additionally installed ".NET Extension Pack".但我有“C# for Visual Studio Code(由 OmniSharp 提供支持)”并且我还安装了“.NET Extension Pack”。

I read documentation form Microsoft and few other tutorials and i have any idea why it doesn't work.我阅读了 Microsoft 的文档和其他一些教程,我知道它为什么不起作用。 I send screenshot of error.我发送错误截图。

在此处输入图像描述

Go to Run > Add configuration... and select .NET Core Console App for debugging. Go Run > Add configuration...和 select .NET Core Console App进行调试。

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

相关问题 为什么在 Visual Studio for C# 上启动控制台应用程序后无法编写任何代码? - Why can't I write any code after starting a console application on Visual Studio for C#? MS Visual Studio C#-有人可以向我解释为什么我的代码不起作用以及如何使它起作用吗? - MS Visual Studio C# - Can someone explain to me why my code isn't working and how I can get it to work? 尽管没有调试错误(C#),Visual Studio Code也不会编译为Unity - Visual Studio Code will not compile to Unity despite no debugging errors (C#) 是否可以在C#中编写Visual Studio代码扩展 - Is it possible to write Visual Studio Code extensions in C# 我为什么看不到我的 <example> s和<code>s from Intellisense? using C# and Visual Studio 2017-2019</code> <code>s from Intellisense? using C# and Visual Studio 2017-2019</code> - Why can't I see my <example>s and <code>s from Intellisense? using C# and Visual Studio 2017-2019 如何在Visual Studio代码中调试C#代码 - How to Debug C# code in visual studio code 如何使用Visual Studio Code调试C#代码 - How to debug C# code using Visual Studio Code Visual Studio Code 无法运行 C# 文件 - Visual Studio Code can't run C# file 为什么Visual Studio 2010 C#Express格式无法正确嵌套代码? - Why can't Visual Studio 2010 C# Express format nested code correctly? 无法在Visual Studio Code上启动c#debugger - Can't start c# debugger on Visual Studio Code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM