简体   繁体   English

没有调试C#代码的选项,只出现IIS Express选项

[英]No option for debugging C# code, only IIS Express option appears

I am using Visual Studio 2022. I don't see any options for debugging my aspx cs script, except I do have an IIS Express option我正在使用 Visual Studio 2022。我没有看到任何用于调试我的aspx cs 脚本的选项,但我确实有一个 IIS Express 选项

在此处输入图像描述

Change your mode to Debug .将您的模式更改为Debug You are currently in the Release mode and because of that you are not able to debug.您当前处于Release模式,因此您无法调试。

If you change the mode of your application from Release to Debug, and run it using IISExpress, you'll be able to debug your C# code if you set a break point in the C# code.如果您将应用程序的模式从 Release 更改为 Debug,并使用 IISExpress 运行它,并且在 C# 代码中设置断点,您将能够调试 C# 代码。

The key part here is setting the break point.这里的关键部分是设置断点。 In your provided example, for instance, you might set a breakpoint on line 13 in the Payment.aspx.cs file.例如,在您提供的示例中,您可以在Payment.aspx.cs文件的第 13 行设置断点。 Then, when the page is loading, the debugger will pause on that line, and you'll be able to step through the code.然后,当页面加载时,调试器将在该行暂停,您将能够单步执行代码。

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

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