locked
If you connect two libraries, then debugging does not work? RRS feed

  • Question

  • User1134142769 posted

    I add two class libraries to the "solution".
    I am running debugging.
    Chrome starts up.
    In Chrome, the start page `\Home\Index.cshtml` appears.
    After `~10` seconds, debugging automatically stops.

    Description.
    I created a project - `WebApplCore`;
    I added a class library to the solution - `Models`;
    I added a class library to the solution - `DBRepository`.

    Project `WebApplCore` - ASP.NET Core;
    Class Library `Models`, `DBRepository` - Net.Standard 2.0.

    Conditional notations for "tests": 
    - "+" - `project` is included in the `decision`;
    - "-" - `project` is not included in the `decision`.


    Test 1.
    WebApplCore - "+";
    Models - "+";
    DBRepository - "-".
    Result: debugging works stably. Turning off debugging does not occur.


    Test 2.
    WebApplCore - "+";
    Models - "-";
    DBRepository - "+".
    Result: debugging works stably. Turning off debugging does not occur.

    Test 3. !!!
    WebApplCore - "+";
    Models - "+";
    DBRepository - "+".
    Result: debugging does not work stably !!!. After ~10 seconds, debugging automatically stops.

    Question.
    Why in **Test 3.!!!** does debugging turn off?

    Picture-1



    Picture-2



    Picture-3 


    Picture-4


    Picture-5




    Update-1
    I did not add references to the `Models`,` DBRepository` libraries in the `WebApplCore` project.
    Project - `WebApplCore` is a" launchable project "

    Sunday, April 12, 2020 11:56 AM

All replies

  • User475983607 posted

    No. the Visual Studio debugger works fine and has for many many years.   All you have to do is start the debugger on the main project.  The project references will allow you to step though the libraries.  Very very simple.  

    Do NOT set library projects as debug start up projects.  Your web application is the startup project.

    Sunday, April 12, 2020 1:46 PM
  • User1134142769 posted

    mgebhard

    No. the Visual Studio debugger works fine and has for many many years.   All you have to do is start the debugger on the main project.  The project references will allow you to step though the libraries.  Very very simple.  

    Do NOT set library projects as debug start up projects.  Your web application is the startup project.


    See "Update-1"
    I correctly understood your answer?

    Sunday, April 12, 2020 3:44 PM
  • User475983607 posted

    See "Update-1"
    I correctly understood your answer?

    Update-1
    I did not add references to the `Models`,` DBRepository` libraries in the `WebApplCore` project.
    Project - `WebApplCore` is a" launchable project "

    The web application or any project cannot magically use a library if the library is not references.   

    https://docs.microsoft.com/en-us/visualstudio/ide/managing-references-in-a-project?view=vs-2019

    Sunday, April 12, 2020 4:23 PM
  • User1134142769 posted

    The web application or any project cannot magically use a library if the library is not references.   

    I do not understand you.
    I know how to connect libraries.

    I have a problem: "debugging is interrupted", but not with connecting libraries.

    I tried various combinations: with adding links to libraries and without adding links to libraries, but "debugging" only works if there is only one library in the "solution" "included" and it doesn’t matter if links to this library are added or not.

    Sunday, April 12, 2020 8:25 PM
  • User753101303 posted

    Hi,

    The library project is compiled in debug mode ?

    Could you be more explicit about what you mean with "debugging" stops. For example if you set a breakpoint into the library code dio you see a paricular message on this breakpoint ?

    Sunday, April 12, 2020 8:34 PM
  • User475983607 posted

    I tried various combinations: with adding links to libraries and without adding links to libraries, but "debugging" only works if there is only one library in the "solution" "included"

    Simply not true.  Share your project on GitHub if you need community assistance.

    Sunday, April 12, 2020 9:53 PM
  • User-854763662 posted

    Hi frmasp897654 ,

    From your screenshots of the project structure , it seems your web app doesn't refer to the things from the class libraries since there is nothing in your class libraries. 

    You could try to check the debug logs in Output window .

    Here is my working demo , you could refer to .

    Best Regards,

    Sherry

    Monday, April 13, 2020 7:15 AM