Open Closed

Debugging of Volosoft.Abp internals #2759


User avatar
0
johannes.schreiner created

In general, how can I, inside Visual Studio or Rider debug what is going on inside your libraries? Let me describe an example issue I am facing: For the application I have at hand I enabled OIDC login by adding an .AddOpenIdConnect to the Services.AddAuthentication(). All fine so far, login with OIDC and our ping identity works. Next steps is to  disable the login page. I found via a google search a github reference that describes I need to set “EnableLocalLogin” to false/0 in the database. I did this in the database, however it’s still not working. Now typically, I would want to set a breakpoint into the controller responsible for the login page and see what is going on. However, it seems to me that something with sourcelink is not working here (neither for ABP commercial nor community edition). While I can step into other libraries using the sources coming from NuGet and MS symbol servers, it is not working for abp sources. Can you describe how, in general, we can tackle issues such as the one described above?Please note that I am not looking for a solution to the exact issue above but rather a systematic approach to debugging issues such as the one described above within Visual Studio or Rider.

  • ABP Framework version: v5.1.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

9 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hello @johannes.schreiner

    All of ABP Framework packages support Source Link that allows to you debug the source code.

    You can use following article for configuring debugging with source link: https://devblogs.microsoft.com/dotnet/improving-debug-time-productivity-with-source-link/

  • User Avatar
    0
    johannes.schreiner created

    As you can read in my initial question, I have sourcelink enabled and it works for other packages. Can you please elaborate on why it could be that sourcelink does not work for ABP.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Because https://github.com/dotnet/sdk/issues/1458 you need to install https://www.nuget.org/packages/SourceLink.Copy.PdbFiles when we use the source link

  • User Avatar
    0
    johannes.schreiner created

    hi

    Because https://github.com/dotnet/sdk/issues/1458 you need to install https://www.nuget.org/packages/SourceLink.Copy.PdbFiles when we use the source link

    Thanks, that resolves the issue - I tested with ABP community edition.

    Two further points:

    • I now get the full debugging experience with Rider (I can navigate all the sources in Rider, it seems not to be working however in Visual Studio). Our company is not mandating the use of Rider and some developers are working with Visual Studio. I can step into your library code with Visual Studio, but I cannot do F12 go to definition - i think visual studio just does not support this for sourcelink? Are you aware of any working solution to navigate all source code and set breakpoints for Visual Studio?
    • I am currently evaluating ABP commercial. Which license do we need to purchase to have the same debugging experience? Will this be available with the Team license or only with the Business license?
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I now get the full debugging experience with Rider (I can navigate all the sources in Rider, it seems not to be working however in Visual Studio).

    Yes, I'm also using Rider. Its debug experience is better than VS, maybe VS needs some settings, I'm not sure.

    I am currently evaluating ABP commercial. Which license do we need to purchase to have the same debugging experience? Will this be available with the Team license or only with the Business license?

    I recommend you to use the Business version, It contains the source code of all modules.

    The Team version encrypts and obfuscates the DLL(source code), you may not be able to debug it well.

    https://commercial.abp.io/pricing

  • User Avatar
    0
    johannes.schreiner created

    Thank you very much for the prompt answer.

    Can you maybe check with some of your colleagues using Visual Studio if they know a way to browse all sourcelink code? Based on this ticket, I assume it is currenlty not possible? https://github.com/dotnet/roslyn/issues/24349

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I remember that I used the source link successfully in VS. It's not the latest vs 2022 though

  • User Avatar
    0
    johannes.schreiner created

    It also works for me after using the fix you suggested - tested in VS2022. If I set a breakpoint into my code, then I can use "Step Into..." to step into ABP code. What does not work however is navigating to the code outside of debugging mode (e.g. using F12 go to definition) - VS will just show the decompiler output then

    Seems like a major pain point for VS users that is not related to ABP in particular but applies to all libraries with sourcelink

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You're right. : )

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11