Forum Visual Studio

Code changes don't show up on device when debugging.

I am having an issue when I debug in Visual studio with a physical device connected to the usb port. I select the device and select debug and it seems to build and deploy without issue. When I make changes to the code (like background color of a StackLayout) and select debug again it acts the same. It seems to build and deploy without issue, but the changes don't show up. I have to remove the app from the device and then debug again in order to get the changes to show up. Has anyone else seen this issue? Anyone know how to solve this issue?


  • WilliamSheltonWilliamShelton USMember ✭✭

    Interestingly, it doesn't seem to be a problem when debugging on the iOS simulator via the Xamarin Build Host.

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    I've had similar issues - changes to my PCL don't show up in the device sometimes, and sometimes don't show up in the simulator.

    There used to be an issue where the build dependency on the PCL wasn't set in the iOS project which caused the issue. Although this has now been fixed I've still seen the issue happen sometimes. I've got into the habit of rebuilding my PCL manually then rebuilding the iOS app before debugging. It's a pain but less of a pain than wondering why is doesn't work

  • WilliamSheltonWilliamShelton USMember ✭✭

    @JimBennett I have had to correct that problem in the past also. In this case cleaning the solution and rebuilding (separately or at once) didn't fix it. The only thing that worked was removing the app from the device/simulator then rebuilding and debugging. I have been unable to isolate the issue. I happens for awhile then resolves with no changes on my part that would seem related. At the moment it seems to be resolved.

  • JeremyHerbisonJeremyHerbison CAMember ✭✭

    In your solution properties, for the iOS and iOS Emulator build types (both debug and release) check the build box for the PCL project. By default it isn't checked in the solution template.

  • WilliamSheltonWilliamShelton USMember ✭✭

    @JeremyHerbison Yes I believe that is what Jim was referring to in his second paragraph also. This is set correctly. In fact this was all working then stopped. It works if you remove the app from the device & then hit debug. But as I mentioned above, it has since started working again...Thanks for the response.

  • mr-incrediblemr-incredible USMember

    Mine does NOT work with a rebuild and removal. Unfortunately, I see the same behavior running Xamarin Studio on Windows 8.1 with an Android Casio device. Basically, Xamarin never correctly attaches (or stays attached) to the code on the device.

  • mr-incrediblemr-incredible USMember

    This finally appears to work for me on Windows 8.1, Xamarin Studio:

    In Project Options -> Android Build
    enable: fast deploy and mono shared runtime
    disable: Embed Assemblies in native code

    NOTE: there are some bugs that may be related: 30318

  • I removed app from emulator and it works

  • ishangoelishangoel USMember

    @EgorGromadskiy said:
    I removed app from emulator and it works

    This method worked for me too.

  • jk8jk8 USMember

    Brilliant, I have been plagued by this for some time and it has been unbelievably frustrating. Removing from the emulator works great !!!! thank you

Sign In or Register to comment.