Debug didn't recompile upon changes to project. Different code behavior on run vs debug

Ran into the absolute weirdest error today. Can’t replicate anymore but replicated a lot of times before I fixed it permanently.

Running Studio version 22.10.5, made a new project on new Windows framework to demo Studio to a large audience and went with the classic RPAChallenge.

Made a preliminary version, ran it on debug, tested basic functionality and developed the rest of the workflow, ran it on debug again, except this time it ignored all my changes and ran the first version of the code I had compiled and ran.

Ran it through “run” instead of “debug,” and then it ran fine, taking my changes into account.

Later noticed that whenever I made a change to my workflow, when I hit “run” it would compile the project again, but when I hit “debug” it wasn’t recompiling. Due to this, debug would skip over any added activities and would step into activities that were no longer there. And if any properties were changed those were also ignored. This was consistent for “debug project” not working and for “run file” working correctly.

Killed studio, killed all UiPath processes, restarted studio, moved my project around in my directory structure, nothing worked, debug would still not re-compile when I made changes.

Then, I went and just added some random package to the project and clicked debug again, and it recompiled and worked as expected. And since I did that, it works and recompiles consistently upon changes to the project. Can’t replicate error anymore.

Just out of curiosity, does anyone know what the logic is like for UiPath to determine that changes have been made and there’s a need to recompile the project? Why it might be different when running from debug vs run?

This sounds like a bug but we have not seen such reports in the past. The hashing we use for detecting changes was consistent for all our users.

Please let us know if you can isolate any pattern to replicate the issue.

1 Like

Unfortunately (or fortunately) this issue has not come up since it happened. Only happened right before a big demo, hahaha. Thank you for your attention. I’ll follow up if I’m able to replicate it.

Did you have a breakpoint where the automation paused, and you never actually stopped it? If you leave it paused in debug mode it’ll let you edit the code but then when you stop it, all your changes are reverted.

Hi @postwick, I did fully stop it and restart it multiple times I even tried to do so on a virtual machine with the same project reading from a OneDrive shared folder. I also killed studio, killed all UiPath processes, restarted studio, and moved my project around to different places in my directory. But when I changed some packages on the project it finally detected the changes

I wonder if it has something to do with OneDrive. Maybe the sync process is overwriting files. I would try moving the project to a non OneDrive folder and seeing if the problem still happens.

The first thing I ever do when I get a new computer is try to destroy the OneDrive on it as much as possible. It is absolute trash for a developer, if you try to keep any code on a OneDrive location you will encounter issues at some point and in general it likes to just muck up files.

I’d be willing to bet some money that OneDrive is the culprit here.
I’d strongly suggest you never mix any coding projects with OneDrive.