When I debug my Xamarin.iOS project from Visual Studio, it builds, installs on the simulator, and launches the app without issue. But on launching, I'm seeing a bunch of Debug tracing from a method that doesn't even exist in my C# code anymore. I can also set breakpoints on the class from which I removed the method at the same line numbers where this method used to be, and I will see the removed method in the call stack when the debugger stops.
I've closed and reopened Visual Studio, reset the connection to the Mac build server, cleaned and rebuilt my solution, and manually deleted the solution output. On the Mac, I've closed and reopened the simulator, and tried Reset Content and Settings, which does clear out the app. But the situation still persists, even after all that. Is there something else can I try on the Mac to make sure that all cached copies of old code have been deleted?
Check your Configuration Manager (the drop down with Debug, Release etc) and check that all the projects are being built. It usually unchecks all the projects you are working with for some unknown reason.
This means that it isn't rebuilding all the projects and it hence shows an old version.
As per your comment of rebuilding each project, this is a classic sign of the projects not being checked to be built on run and why you have to do it manually.
I had a similar problem (though on an Android emulator).
What didn't work for me:
What worked for me?
Uninstalling the app from the emulator and then running Debug again. It was an Android emulator, so I uninstalled by clicking on the app icon and holidng for long, and then dragging it to "Uninstall App". On an iOS simulator it should be similar.
In your project folder delete the bin and obj folders. This works for me but is still annoying.
In the iOS Simulator (on the Mac) click the "Reset Contents and Settings" entry the main menu.
Well this worked with my Android project suffering from the same issue:
then it worked normally
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With