Note that there are some explanatory texts on larger screens.

plurals
  1. POVS2012 Breakpoints are not getting hit
    text
    copied!<p>I have a class that looks like this:</p> <pre><code>public class MyService { private MyService(){} public static string GetStuff() { var stuffDid = new MyService(); return stuffDid.DoStuff(); } private string DoStuff() { //do stuff } //other private helpers } </code></pre> <p>Obviously I left a lot out, but thats the general shell.</p> <p>Now, I have a unit test:</p> <pre><code>[Test] public void MyTest() { var results = MyService.GetStuff(); } </code></pre> <p>I set breakpoints on my unit test, and I can see that <code>results</code> has data. However, I set breakpoints literally all over <code>MyService</code> and nothing gets hit unless I put them on a curly brace. Which I can't understand since <code>results</code> has data, my <code>return</code> statements in <code>MyService</code> should be getting hit, right?</p> <p>Am I missing something? Did I completely forgot the most basic rules of something? How come nothing in <code>MyService</code> gets hit? And if I manually step into it with <code>F11</code>, it just hops around and doesnt even go thru every line like I would expect. Also when I step thru manually I tend to hit certain code after I should have hit it originally. And any <code>switch</code> statements seem to default to whatever the first option is, even tho the value being switched should CLEARLY enter a different <code>case</code>.</p> <p>I've even tried making <code>MyService</code> constructor <code>public</code> and taking away all <code>static</code> methods, and it still doesnt work.</p> <p>Edit: My Tests and 'Core' code are in the same solution, but different projects(<code>Test</code> and <code>Core</code>, respectively). Other tests don't have an issue hitting break points in <code>Core</code>, only this on particular test(the only test that is testing <code>MyService</code>.</p> <p>Edit 2:</p> <p>I've deleted my PDB files and cleaned solution. Still nothing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload