Rider is running/debugging an old build

You have made some changes but Rider sticks to an old build? First of all, have a look at your Run/Debug Configuration and make sure that "Build project before run" is added to the list of actions to be performed before the launch:

In case it is there then please let us know about the problem. Here are the troubleshooting steps:

1. Go to 'Rider -> Settings/Preferences -> Build, Execution, Deployment -> Toolset and Build'.

2. Check which MSBuild version is used. Does it lays in .Net SDK or in Visual Studio folder? 

 3. Is "Use ReSharper build" checkbox turned on?

 4. Turn on "Write log to file" checkbox and choose "Normal" verbosity. IMPORTANT: don't forget to turn off this checkbox when you collect all the logs. 

5. Close Settings dialog.

6. In case you are on Mac/Linux then check your Mono version.

7. In case you have .Net Core project then check your .Net Core version.

8. Make some changes in the code and run your project.

9. Make some changes in the code again and build solution via the menu on the top.

 

10. Make some changes in the code one more time and build selected project via Solution Explorer.

11. Go to 'Help -> Show Log in Explorer/Finder/File Manager'.

12. Zip all the log files in the folder and attach it to Support request or Youtrack ticket.

13. Turn off "Write log to file" checkbox (see step 2). 

That is it - we will analyze the log files and see why the project doesn't run correctly. Thank you for your cooperation!

 

3 out of 24 found this helpful
36 comments

I guess more people are having issue with this since the answer was updated yesterday? Do you have an youtrack issue tracking this opened?

23
Avatar
Permanently deleted user

Currently, "Use Resharper Build" 's default value is "true", but it has to be set "false", in my opinion.
Because "Resharper Build" is not reliable that much yet.

Especially, dependent projects' modification is not tracked correctly.

Edited by Permanently deleted user
7

July 2021. Rider 2021.1.2. This still keeps happening from time to time 😟

4

I have the same problem.

It doesn't work well even for a Console project with one dependent Library project. 

In my feeling it becomes buggy starting from JetBrains Rider 2020.1.3 Build #RD-201.7846.1, built on May 15, 2020 version and/or .NET Core 3.1.

But as soon as I turn "Run ReSharper Build" setting OFF - everything start working as expected.

 

Edited by Michael
3

This is still an issue for me in Rider 2020.3, but only when I use ReSharper Build :( Really love the ReSharper Build feature, as it's much faster than the regular build process, but I had to disable it because of this issue, as it's not fun to try to figure out whether your change had no effect or it's Rider still using old build, when you actively work on a new feature.

I really hope you guys fix it soon.

3
Avatar
Permanently deleted user

the same issue with the debugger, very annoying

even build of the project with changes sometimes can be useless, and you need to rebuild all project dependencies...

2

I've also started experiencing this issue recently. 

Setup:
ProjectA
ProjectB (depends on ProjectA).

1. Configure default run of ProjectB.
This results in:

2. Make a change in ProjectA, click Run or Debug, build output shows ProjectA being rebuilt, but not ProjectB , hence project artifacts are not copied.
Sometimes it does rebuild ProjectB, so the occurrence seems a bit random. 

Edited by Donatas Saulys
2

This is crippling my development experience, since I pretty much have to run the debug session, stop and run it again for it to pick up my changes.

 

Edit: just turned off the "Use Resharper Build" setting and the problem seems to have gone away. For good hopefully.

Edited by Robert
2

Julia Vaseva any update on when this will be fixed? I'd love to use Resharper Build as it's faster, but it's not worth it if I don't have confidence that the latest version is running.

Also, for step 2, you say "Check which MSBuild version is used. Does it lays in .Net SDK or in Visual Studio folder?" but you don't say which should be used. Which should be used?

Thanks!

2

steps to reproduce this seem pretty simple.

Library A (root)

Library B (references A)

Program (references B)

be up to date

make changes to Library A

run Program

Library A builds, but Program does not build

Program runs without having rebuilt or received updated LibraryA.dll

2

All our 5+ developers has downgraded to 2020.3.4. It works.

So when this is fixed, we can upgrade. But a bit frustrating to pay for a product that is not working.

1

I've disabled Resharper Build too to hopefully get rid of this problem. So many times I run my test, but because the code I changed was in the implementation instead of the test, the test still fails because it's running the old code, and I constantly have to make a null edit (space + backspace) to dirty the test file so that the test project will actually build.

I wonder if this issue indicates that JetBrains does not "eat their own dogfood". Unless they have a very particular project structure or build method that happens to miss the cause of this problem, any moderate use of Rider should encounter this issue very regularly. The fact that JetBrains has no idea that this happens or why it happens seems to indicate they are not using their own program.

1

I guess I still haven't quite pinned this down, but I do finally have a workaround.

You can manually dirty a file in the program project to force it to get built, but you can also dirty it with a command. Write a .bat file that says "copy %1+,, %1" (which is weird way to dirty/touch a file in windows command line), and then invoke that bat file as an external command before the build project step. This ensures that your program project actually gets built.

1

So, it seems like as an optimization, you intentionally do not build a project if it has not changed, and only copy updated dependencies to it. So in this example:

Library A (root)

Library B (references A)

Program (references B)

If I change Library B, then Program does not build (intentionally), and instead LibraryB.dll is copied to Program\bin

When the problem occurs, the copy to the dependent project does not happen.

I made a change to Library B and the build window says something like this:

skipping a few things (RunRdlCompiler, etc.) that I think are ok

call to csc.exe

CompilerServer: server processed compilation

Copying file from Library B\obj\LibraryB.dll to Library B\bin\LibraryB.dll

Library B -> Library B\bin\LibraryB.dll

Copying file from Library B\obj\LibraryB.pdb to Library B\bin\LibraryB.pdb

Finished Building Project Library B

Build Completed

Build Succeeded

So, notably, the line "Copying file from LibraryB\bin\LibraryB.dll to Program\bin\LibraryB.dll" is missing.

This was invoked via the Debug button on the toolbar next to the (Launch) Program action. I have Resharper Build enabled (maybe I shouldn't?)

In this case, right clicking on Library B and choosing Build did not help (it did nothing, thinking that everything was up to date). Right clicking on Program and choosing build DID copy the DLL this time (when it hadn't previously when running Program from the Debug button). I made no code changes in between. This is Rider 2021.3.3.

1

Testing this from scratch, it does not build Program when a Library is updated, but it does copy DLLs and the new code is run. I will have to pay attention to what exactly is happening in the build window when the problem emerges.

1

I also started having this issue since yesterday after updating. The worst part is that Visual Studio 2022 also started to have the same issue after the update, so I can't work on my project at all.

Downgrading to 2021.1.5 did not work for me either (the version I was on before)

1

I'm experiencing this issue since at least the last EAP version updates and current stable 2021.3.2 version as well.

1

I am still experiencing this issue with Rider 2022.3. When I change the code, then start the debugger, old code is hit. Very obvious with breakpoints set. Issue went away when turning off ReSharper build. 

1

When I run a project (using F5) it seems to build dependencies, but not the program project itself, so it basically runs the old .exe using the new .dlls. (or something? now that I think of it, would that even cause this problem? maybe it doesn't copy the dlls?)

I can see it say "building <library>" but then says "build complete" without ever having said "built <program>"

It's annoying because your feedback loop of <make a change>, <test change>, <make another change>, etc. breaks down when you're really running the last version of the code, not the new version.

I notice that this happens even if I specifically choose to build the project, not just press F5. In my case I have made changes to a transitive dependency, and not to the project being built.

Edited by Dave Cousineau
1

Great!
With the exception of this issue it's a great product, would be a shame if people would be missing out :)

0

Donatas Saulys wow, that really helped! Big cheers to you!

0

Another issue with the "Build Project" setting is it doesn't seem to be observed when the "Store as Project File" option is selected. The correct value is present in the project file, but after pulling in updates on a colleague's machine, the "Build project" setting still had to be manually configured.

Edited by Ryan Haney
0

Update: I am still having those issues after all.

0

This problem has been bothering me as well. I find myself stopping my debugging session, cleaning and restarting my debugging session. If I don't clean in-between, my new code is not pulled in. When I forget to go through this process I chastise myself for not remembering to clean. It's a real time-suck. Ideally, I should be able to hit the restart button to stop-build-run in one go with all current changes incorporated.

For me, uninstalling and re-installing is not ideal. There are many people experiencing this issue and the source of the problem needs to be discovered and fixed. This issue has survived many upgrades.

That being said, I think I've found a solution.

Dave Cousineau had mentioned a scenario that I'll quote here:

Library A (root)

Library B (references A)

Program (references B)

be up to date

make changes to Library A

run Program

Library A builds, but Program does not build

Program runs without having rebuilt or received updated LibraryA.dll

If we look at the auto-generated run configuration for "Program" and edit the "build project" entry, we see something like this:

Setting this entry to "Program" instead of the default "Selected Project" seems to produce the desired behavior. Is there a bug with the "Selected Project" default setting?

Edited by Ryan Haney
0

I did it some months ago, can't recall exactly, but if I would do it now:
1. Uninstall all tools from Jetbrains toolbox if you're using it.
2. Uninstall all jetbrains programs from windows "Add or remove programs".
3. Delete following folders:
C:\Users\%USERNAME%\AppData\Local\JetBrains
C:\Users\%USERNAME%\AppData\Roaming\JetBrains
4. Then reinstall what you need.

Alternative would be to use one of uninstall tools

0

Piotr Kolodziej for me the issue disappeared when I fully cleaned all jetbrains installations, corresponding application data, caches and reinstalled from scratch. 

0

I am very close to cancelling all my Jetbrains subscriptions. Rider is completely unusable to me, I've wasted so much time because of this issue.

0

Graham sometimes what you describe can happen if you have an assembly reference rather than a project reference. this can sometimes happen with Resharper/Rider's automatic add reference feature. when this happens, the assembly is old, even though the code has been updated. try to find the related reference and make sure it is a .csproj reference and not a .dll.

0

Any update on this? Latest version of Rider (2022.3) has essentially become complete unusable. It's not picking up any code changes, but when you debug it shows the new code. In my case, I changed a "string" to a "long" but when you look at the debugger output it shows it as a string even though the codefile is a long.

I then disabled resharper build and now although "rebuild" works for every project when you run/debug it fails saying it can't find those projects it's just built.

To fix this I had to re-enable resharper build and then it picked up the latest changes

Edited by Graham
0

Please sign in to leave a comment.

Have more questions?

Submit a request