4

I have a really weird Xamarin.Forms bug I haven't seen before: When I build and deploy to simulator or device from Visual Studio 2017 on my PC the result is not aligned with the source code. What I see is some older build.

If I build from the same branch directly with VS2017 on the Mac instead I get the expected result.

Could this be some caching issue with the Mac Build Agent? If so; is there a way to clear it to ensure it doesn't deploy older builds?

[EDIT 1]

I have taken all the usual dark-magic tricks such as removing/restoring all packages, cleaning the output folders and reboot the Mac before rebuilding the solution. I also made 100% sure I wasn't using old source code.

Jonas Rembratt
  • 1,550
  • 3
  • 17
  • 39
  • Have you done a Clear, then a project Rebuild? – Tom Dec 14 '18 at 08:49
  • I have. I have also removed and restored all packages and double- and triple checked the source code is indeed current (removed/re-cloned) and rebooted the Mac. Pretty much can't come up with more ideas other than to ensure the build agent isn't deploying some old ipa but I don't know where it keeps its builds these days. Good question though and I updated the OP to clarify. – Jonas Rembratt Dec 14 '18 at 08:54
  • @JonasRembratt have you found a solution to this? i just updated to latest visual studio version and now im having this issue too. It's crippling my development so much :( – Vibol Jan 03 '19 at 16:31
  • Alas, I have not. I only have one project that i splagued by this behavior and for now I can only develop using my Mac because of it. I still haven't been able to figure out where the Xamarin Mac Agent is located on the Mac so I cannot test cleaning its build folders. – Jonas Rembratt Jan 05 '19 at 10:34
  • Did you ever found a solution? I now have this same issue. – SEG.Veenstra Aug 06 '19 at 07:35
  • Not really. But next time it happens I would try removing the build agent's output, found as a sub folder at: `/Users//Library/Caches/Xamarin/mtbs/builds/` – Jonas Rembratt Sep 04 '19 at 08:33

1 Answers1

-2

Kindly,

  1. Clean the solution,
  2. Uninstall the app on the emulator.
  3. Close VS
  4. Rename the OBJ folder in the project folder (same place you have the bin folder) to OBJ.old (in case you need to restore it)
  5. Repeat step 4 for BIN folder
  6. Restart the VS and open open the project
  7. REBUILD the SOLUTION - you should have BIN and OBJ created for all projects.
  8. Done
waletoye
  • 364
  • 2
  • 9
  • Well, I had already tried clearing the bin/obj folders so I doubt this would work. But I then updated the code for one of the referenced projects and suddenly the problem went away. This does not mean I solved the problem so I would still like to know where the Mac Build Agent is located and whether there's a way to clean its build output. Anyone? – Jonas Rembratt Dec 14 '18 at 12:32
  • That is the solution. Step 7 should be REBUILD the SOLUTION (not project). That way your problem would be gone. – waletoye Dec 15 '18 at 08:07
  • Sorry, but no. I had already done all of your suggestions (except renaming obj => obj.old) and it didn't work. There seem to be some problem, possibly related to the Mac Build agent resuing old builds. – Jonas Rembratt Dec 17 '18 at 08:53
  • Just to be sure I finally followed you recommended solution to the letter and, as expected, it had no effect. Have you had this problem yourself and used this approach to resolve it? – Jonas Rembratt Dec 17 '18 at 12:32