如何在Visual Studio中调试ASP.NET MVC代码?

问题描述 投票:0回答:1

我在 .NET 上使用 C#

Microsoft Visual Studio Community 2022
Version 17.7.4
VisualStudio.17.Release/17.7.4+34031.279
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools   17.7.273.65229
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.7.273.65229
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.7.273.65229
Azure Functions and Web Jobs Tools

C# Tools   4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter   17.0.23189.3
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager   6.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Python - Profiling support   17.0.23189.3
Profiling support for Python projects.

Python with Pylance   17.0.23189.3
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core)   17.7.3.2333001+0ab18affdf2a37647768d0e25f5f021bee6257a1
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.7.10.1
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.20829.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.7.0-beta.23314.10+e612cf93b989503c89e3a5830090062b7ab5e143
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

我知道如何处理 .NET 表单。

我有 ASP.NET MVC 代码(我不是开发人员)需要跟踪和修复,但这是我第一次使用 ASP.NET MVC。

每次我尝试在代码中添加断点时,它都会“不会被击中”

我确定它处于调试模式

但是仍然无法使代码调试

知道为什么会发生这种情况以及如何调试它吗?

c# asp.net-mvc visual-studio debugging
1个回答
0
投票

您可以参考微软学习调试 ASP.NET 应用程序了解如何在 Visual Studio 2022 中调试 ASP.NET MVC 代码。 这是我的详细步骤。

首先,我创建了一个 ASP.NET MVC 应用程序。

其次,我编写一些代码并设置断点。

三、请按F5运行mvc项目

四、请点击Contact触发断点

最后可以看到断点可以调试了。

© www.soinside.com 2019 - 2024. All rights reserved.