I have a class that looks like this:
public class MyService
{
private MyService(){}
public static string GetStuff()
{
var stuffDid = new
This one's pretty obscure :
Make sure you don't have two virtual directories with different App Pools pointing to the same physical location on your harddrive. During development this is something that can sometimes happen for testing, or by mistake.
I'm not 100% clear on the technicalities but I had two AppPools and two virtual directories and no breakpoint was ever hit because I presume the physical path was somehow mapped in IIS/Visual Studio to the other apppool and not the one that was actually executing.
It could be beacuse you are only debugging 1 project not both Test
and Core
You can set VS to debug mutiple projects at once, you can do this by right-click your solution > Properties > Common Properties > StartUp Project
Here you can set "Multiple Startup Projects"
Just set both Core
and Test
to start. This may solve your issue.
Your code indicates a "service", which could be running as a separate process. If that's the case you can have your assembly loaded, so breakpoints would be solid red circles but another copy of the assembly, running in a separate process is actually handling the requests.
I have the same issue. Maybe my solution will help you to solve your problem. Just in "Attach to Process" for option "Attach to" select value "Avtomatic: Native code". Best regards.
Just make sure that you have build your assembly with the debugger symbols.
This option has to be filled with "full":
Right-Click your project containing your code file with the break points not getting hit. Choose "Properties".
After project properties have been opened, choose "Build" tab. Watch out for the "Advanced..."-Buttom at the bottom of the tab page. (Within the "Output"-Group")
Click this button and choose "full" for the "Debug info" property. This should be a reason for breakpoints not getting hit. Visual studio uses the symbols saved in the pdb-files to find the exact position of the break point. If these files are not created, no breakpoints are hit. Maybe you disabled the creation of these files in order to tidy up your project file structure. This was a situation I recognized that I need these files.
Maybe your Test
project is referencing an older Core
binary, rather than the Core
(source code) project?
Try re-adding the reference in your Test project:
Go to your Test
project and remove the reference to the Core
project.
Now select the References folder and right click it and select the menu option to add a new reference. When in the Reference Manager dialog, make sure you are selecting Solution
and then Projects
on the left. Then in the middle of the Reference Manager dialog, select (check) the Core
project.
Try debugging again and see if that helps.