I have a class that looks like this:
public class MyService
{
private MyService(){}
public static string GetStuff()
{
var stuffDid = new
You need to make DoStuff static.
private static string DoStuff()
{
//do stuff
}
I ran into a similar issue. It turned out that for me it was a bad migration from VS2010 to VS2012 with the *.testrunconfig
file. I deleted the old one and set up a new one to resolve the issue.
Some more stuff to try:
Check if the loaded symbols match the debugged executable:
Open a VS command prompt and cd to the directory where the executable you debug resides.
Then do a dumpbin /PDBPATH:VERBOSE MyServiceExecutable.exe
and scan the output for "PDB age mismatch" (Ref: http://msdn.microsoft.com/en-us/library/44wx0fef.aspx)
Not sure about VS 2012, but older versions of VS had a bug where the wrong source file would be displayed, provided that you have two source files in your project that have the same name, even when they are located in different folders. So if your project contains another source file with the same name, see if renaming one of them helps. (Update: Seems VS 2012 is affected too.)
This sounds like the pdb files are not updated in your test sandbox.
1) Ensure that you are in debug mode.
2) Can you try and include a deployment item for the pdb files explicitly?
3) If 1 and 2 fail , I have found that sometimes visual studio requires a restart :)
If it is in release mode switch it to debug mode.
You could try to add a Thread.Sleep(5000)
in GetStuff
method and use Attach to Process
Visual Studio > Tools > Attach To Process and see if breakpoints below that line gets hit.