28

I am trying to set a breakpoint in JetBrains Rider, but the debugger isn't breaking.

I know for sure the application should reach the code I'm trying to break on, as changing string literals appears in the program.

I have completely reinstalled all my JetBrains programs (wiping settings). I've also tried every answer in this thread: break point is not hitting while debugging, with no luck.

This bug doesn't occur in Visual Studio, but does occur with any project in Rider.

It also doesn't happen on my other copy of Rider that I use on my other PC.

I appreciate any help, thanks!

Jessica
  • 1,621
  • 2
  • 18
  • 34

12 Answers12

53

One more caveat: I started using Rider again after an absence, I was pressing the "play" (triangle) button rather than the button with a picture of a bug.

(D'oh!)

Baron
  • 975
  • 8
  • 12
9

For .Net Framework projects:

This can happen if Rider attached the debugger to a different process than the process that IIS is using.

  • Open Run on Rider menu and click on "Attach to process" or ctrl+alt+F5
  • Type w3wp, this will find all the processes IIS is running on. If you found multiple processes you can hover on them to see which AppPool is related to that process.
  • Click on the process to attach debugger to it.
  • The breakpoint should be hit now.

And make sure you are using the URL that Rider provides you when you run your project (http://localhost:XXXX), because the URL that Rider uses might be different than the Host Name you set for your IIS.

EspressoCode
  • 287
  • 3
  • 8
6

I've found what was causing it.

As of Rider 2018.1.3, the solution you're running must be on the same disk as the copy of Rider you're using.

This issue is referenced on JetBrains support here.

You can temporarily solve this by either moving your solution to the same drive, or by reinstalling Rider.

Jessica
  • 1,621
  • 2
  • 18
  • 34
  • 1
    This was my issue too but debugging worked in VS2019 - In Rider, when hovering over the disabled breakpoint, you will see a message like module not found in D:\Folder\Code\Script.cs. Move the project to the same drive as rider, clean the solution, restart windows, run from Rider successfully hit breakpoint. Also make sure your Unity project build settings have "Development mode" and "Script debugging" enabled. – Alex Jul 06 '21 at 10:58
  • Is this still the case in 2023.1.1 version? – MaxP Apr 27 '23 at 14:28
  • Doesn't look like it, my personal copy of Rider is on a different hard drive to most of my solutions, and I can debug ok (running Rider 2023.1) – Jessica Apr 27 '23 at 15:33
3

What I did before was :

  1. Open the solution
  2. Set some breakpoints
  3. Click the 'bug' button in Rider (next to the play button)
  4. Chrome would open up automatically with an URL pointing to my services
  5. The service would work as expected, but breakpoints would not work
  6. Stop the service
  7. Modify some code
  8. Start the service
  9. Refresh the Chrome Windows from step 4
  10. I would see the modifications in Chrome. But no breakpoints would get hit.

Now the only thing I changed is that in after step 2 I now do a

Run --> Attach to a local process... --> w3wp

After this, I just do the same steps as before, but now the breakpoints do get hit...

Refrence

Mohammad Fazeli
  • 648
  • 10
  • 13
3

If you're using .NET core and IIS, make sure the Application pool has 'No Managed Code' under '.NET CLR Version' in the Basic Settings:

enter image description here

Jeroen K
  • 10,258
  • 5
  • 41
  • 40
2

For anybody who has the same problem in Xamarin Android project. For me the breakpoints in the android project where working, like in the main activity but not in the shared project.

How i fixed it: Go to your android.csproj file and edit it. Search your build target and check for <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> If this is true, breakpoints in additional modules are not working. Set it to false, or even better, remove this line completely.

Stefan Habacher
  • 153
  • 1
  • 8
1

In relation to Jessica's answer above, it appears that opening a solution in Rider using the System absolute path (i.e. /System/Volumes/Data/Users/...) appears to act as though it's on a separate drive.

After driving myself crazy for about four hours, I created a new solution and changed the solution directory from the system path to /Users/... then copied my project to this new solution which fixed the breakpoints, and opening the project from the Rider welcome screen now shows the solution directory as a relative path (~/Users/...)

Luke
  • 36
  • 6
1

Another solution for you (or other people who come across this):

When you have "COMPlus_EnableDiagnostics": "0" in your configuration or launchSettings you won't be able to hit breakpoints either.

chrjs
  • 2,375
  • 1
  • 25
  • 41
1

Cleaning and rebuilding the solution, and then removing and readding the breakpoint worked for me!

Oli
  • 130
  • 1
  • 5
1

None of these solutions worked. Solutions of clearing caches through the Rider interface and stuff like that, none of them worked. None of them.

The problem: a previously working referenced project of custom code (not some external library or nuget package) broke the breakpoints. Breakpoints outside the package worked, but not in the referenced project. I was getting that "stop sign" symbol in which it couldn't resolve a method.

The only thing that worked was to completely erase all instances, and previous instances, of Rider from Application Support and Caches on my mac. After following the instructions to completely erase Rider on their website, and then reinstalled it, I was able to get the breakpoints working again. Sorry, but for some of you this may be the only thing you can do.

Paul Carlton
  • 2,785
  • 2
  • 24
  • 42
1

I had this problem too and the cause was a spurious <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> in the csproj. Removing this setting restored debugging capabilities.

0xced
  • 25,219
  • 10
  • 103
  • 255
1

In my case the breakpoint not being hit when debugging a project with IIS Express.

The issue has been solved after running Rider as administrator

Thanks to @David smith's answer here: Can JetBrains Rider work properly with IISExpress?

ayala
  • 331
  • 1
  • 9