Iris Classon
Iris Classon - In Love with Code

Possible Bug: Rider Not Building MAUI Project When Deploying to Simulator

TL;DR Rider wouldn’t build changes, it used the previous build when deploying to the simulator. Manually adding the build step in the run config for the iOS app fixed this. Deleting the .idea folder also seemed to help.

You know it’s Monday when you start the week with the same annoying bug you ended the previous week with. The migration to MAUI continues, and I continue to document the wins and blows. I’m not completely sure, but it seems that the latest bug is related to the editor. I’ll investigate this more if I have the time, but for now I’m just glad everything works again.

The problem: Rider deploys directly to simulator but doesn’t build the projects. I noticed this when breakpoints weren’t hit, and hovering over them I was told that the module could not be loaded. If I deleted the bin folder and ran Debug, then Rider would lose its mind and angrily complain about missing files in the simulator folder.

Building manually, by using the trusted dotnet build, a different editor or right clicking on the project in Rider, would build and include recent changes. Running debug on the simulator again would then include the latest build.

I tried:
Emptying cache
Remove Rider build as default
Restart rider and the computer

No luck with that, but it’s always a good place to start. On and off, empty the cache.

I looked at the build log and noticed that the restore task was the only task run.

Done executing task "RestoreTask". 
1>Done building target "Restore" in project "X.csproj".
1>Done Building Project "/Users/irisclasson/Repos/x-app/X/x.csproj" (Restore target(s)).

In the main menu, Run – Edit configurations I could see that there was no build step. Build is implicitly run, but for some reason explicitly adding the step solved the problem for me. These settings are stored in the .idea folder (the Rider project IDE settings) if you use local configurations instead of shared. I tested deleting the .idea folder and letting Rider generate it again for me, and the build was back. So yes. Hope this helps. I’ll look into the why when I have time. Cheers!

Comments

Leave a comment below, or by email.

Last modified on 2024-01-29

comments powered by Disqus