How to set a breakpoint to inspect code in the ConfigurationSection class?

lm1212 141 Reputation points
2023-03-03T04:46:54.94+00:00

This is for my own learning and understanding.. ( I have just got back into coding after having to take around 3 months off).

I have the following line of code in the program class for a standard MVC project:

var connectionString = builder.Configuration.GetSection("conSettings")["conVarsConnection"];

I want to better understand how methods and classes are operating when the above line is called (in particular .GetSection)

But if I set a breakpoint at the ConfigurationPath.GetSectionKey method in the ConfigurationPath class, I get the following message on it when the code runs: " The breakpoint will not currently be hit. No symbols have been loaded for this document." So I cannot step through this code.

Does anyone know a way to allow myself to step through this code so I can inspect it? (see how it is operating).

Or any alternative way to achieve the desired effect?

Thank you.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,793 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 29,871 Reputation points
    2023-03-03T15:00:59.96+00:00

    If I understand the intent correctly, you want the ability to debug ASP.NET Core libraries.

    Debug .NET and ASP.NET Core source code with Visual Studio

    The breakpoint will not currently be hit. No symbols have been loaded for this document." So I cannot step through this code

    Make sure your solution is set to the debug configuration.

    Capture

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.