Search code examples
debuggingxamarin.iosvisual-studio-mac

Updates to code on Xamarin iOS application are not applying at runtime/debug


I have an application which I am developing. Everything has been going smoothly, but suddenly my code no longer applies when I deploy. If I make a change and deploy the app to my iPhone, the app launches but my changes do not appear.

Furthermore, my breakpoints hollow, which I believe means that the code that is running differs from the code in Visual Studio.

enter image description here

I am running Visual Studio 2022 on Mac, deploying to my iphone hardware.

I have tried:

  • Normal build and run
  • Build -> Rebuild Solution

How can I solve this problem?


Solution

  • I was able to solve the problem with the following steps:

    1. Open the location of my iOS project (note that I also have Android projects and other libraries, but I only did this for the iOS location)
    2. Delete the bin and obj folders
    3. Build project, observe there are now errors due to references missing to classes which should come from nuget packages
    4. Right-click on the Packages folder in the solution explorer and select Restore
    5. Build and deploy the project

    I'm not sure why my project got in this state, but this seems to solve it when it does happen.