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!

 

24 comments
Comment actions Permalink

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
Comment actions Permalink

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 progsung
6
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Not sure how related this is, but this is the best place I've found after much Googling.

I have what looks to be the same issue, but when using Resharper as part of Visual Studio.
I've enabled Resharper Build and if I just hit Debug > Start then it will correctly build whatever projects require building, but then doesn't use the artifacts produced for the debugging session. I've verified this by adding / removing various statements and that no breakpoints are hit because the executing code is different from the source.

Visual Studio 2019 Professional, 16.7.2

Resharper 2020.2.1

0
Comment actions Permalink

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
Comment actions Permalink

Hello,

This seems related to another issue I have. When i do changes on a running program, and apply the changes. It still runs the old version. The changes are not applied at all.

0
Comment actions Permalink

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
Comment actions Permalink

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

4
Comment actions Permalink

With `ReSharper Build` it might be caused by indirect dependencies in your solution.
Workaround might be adding ProjectReference-s from starting project to those, which are not build automatically,
If you think, it is a bug, please create an issue with Help->Report a Bug and you would get asked for more details during investigation.

0
Comment actions Permalink

Also a reminder to check if you have a docker running on the same port...

Edited by Rosent92
0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Mikkel, we would be glad to investigate your issue. Would you please open latest Rider version, reproduce the problem and call Help|Report a Bug, agree to attach logs.

0
Comment actions Permalink

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
Comment actions Permalink

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

1
Comment actions Permalink

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
Comment actions Permalink

Marko We do not have a YouTrack issue for this problem, and, unfortunately, we didn't manage to reproduce it on our side yet.

 

Dave Cousineau This scenario works fine on my machine on three sample .NET 5 projects. Would you mind sharing more details about the problem with us? (cc Dominic Warchalowski Denis Marko)

We normally need the following:

1. A screenshot of `File | Settings | Build, Execution, Deployment | Toolset and Build` page to see the MSBuild version and `Use ReSharper build` toggle

2. Rider logs collected right after the issue occurred (Help -> Collect Logs)

3. Repro project/solution with the steps to reproduce the problem

Please collect the information and add to a new YouTrack issue.

Edited by Julia Vaseva
0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

Please sign in to leave a comment.

Have more questions?

Submit a request