Bug 16391 - MT3006 / XS rebuilds my Project EVERY TIME
Summary: MT3006 / XS rebuilds my Project EVERY TIME
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: 7.0.4.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
: 17195 ()
Depends on:
Reported: 2013-11-21 14:41 UTC by chris
Modified: 2015-01-08 17:24 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

release-auto-build-on-deploy-to-device.txt (51.27 KB, text/plain)
2013-11-21 14:41 UTC, chris
Test Project (10.29 KB, application/x-zip-compressed)
2014-01-13 02:41 UTC, narayanp

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description chris 2013-11-21 14:41:05 UTC
Xamarin Studio rebuilds my project every time - even if I immediately deploy after building, it rebuilds again.


- select release/ios device
- "Rebuild All" - completes without issues
- "Upload to Device"

- it builds again before uploading

- it should upload without building

As suggested in http://forums.xamarin.com/discussion/10334/mt3006-xs-rebuilds-my-project-every-time I've added "-v -v -v -v" to the additional mtouch arguments and attached the output (id's removed).
Comment 1 chris 2013-11-21 14:41:53 UTC
Created attachment 5498 [details]
Comment 2 Rolf Bjarne Kvinge [MSFT] 2013-11-21 18:45:29 UTC
For some (unknown from the log) reason the main executable is recompiled, which triggers a recompile of everything else => Xamarin Studio, since that's where the C# compilation is handled.
Comment 3 narayanp 2013-11-21 23:26:49 UTC
I have cjecked this issue with following builds:

All Mac
X.S 4.2.1(build 1)
Mono 3.2.4

I am able to reproduce this issue. Below are the details:

Build Output: https://gist.github.com/saurabh360/ec38845dcf6d22c608eb
iOS Device Log: https://gist.github.com/saurabh360/1ce959af7e45b97a6884
Screencast: http://screencast.com/t/nt2bBu091m9k
Comment 4 Jeffrey Stedfast 2013-12-02 14:46:59 UTC
This seems to work fine in git master and code was recently added to make sure that the timestamp on the native exe was newer than the managed .exe, so that's probably what fixed this.
Comment 5 chris 2014-01-07 10:05:30 UTC
I still have this problem in 4.2.2.

From your comment I can't tell if it's supposed to be fixed in there. If not, when can I expect a new release?
Comment 6 Jeffrey Stedfast 2014-01-07 11:09:59 UTC
4.2.2 was just a re-release of 4.2.0 with a few license activation fixes.

4.2.3 will include the fixes from git master.
Comment 7 chris 2014-01-08 16:48:00 UTC
I still have the issue with 4.2.3 build 28. I emailed you the build output.

It only works when I create a simple test project (XS/New project...).
Comment 8 Jeffrey Stedfast 2014-01-08 18:45:18 UTC
Thanks for keeping us updated, Chris.

As I was debugging another bug today, I discovered that the "Clean" command didn't quite delete everything it was supposed to, so I ended up fixing that. Not sure if that is the case, but it might be. I'll try to provide you with another 4.2.3 build tomorrow morning.

narayanp: could you attach your sample project to this bug report so that I can reproduce this?

Comment 9 Jeffrey Stedfast 2014-01-09 17:56:04 UTC
Doh, I had meant to upload a build for you to try (although I'm not optimistic that it'll fix the issue):

Comment 10 chris 2014-01-10 17:42:04 UTC
I tested the new version but the behavior is unchanged.

Removing bin/obj before starting the test also has no effect.

I tried to make a sample that has the same issue but I haven't found anything so far.

FYI: I'm using the monotouch compiler from stable.
Comment 11 Jeffrey Stedfast 2014-01-10 19:31:52 UTC
PJ: can you poke narayanp and have him attach the sample project he used to reproduce this?
Comment 12 narayanp 2014-01-13 02:41:50 UTC
Created attachment 5819 [details]
Test Project

I have attached test project
Comment 13 Jeffrey Stedfast 2014-01-13 15:28:06 UTC
I don't seem to be able to reproduce this bug with the test project that narayanp attached.

narayanp: are you sure that's the right one?
Comment 14 Jeffrey Stedfast 2014-01-13 17:05:59 UTC
never mind, I found a way to reproduce this... looks like asset catalogs are the culprit.
Comment 15 Jeffrey Stedfast 2014-01-13 17:54:16 UTC
*** Bug 17195 has been marked as a duplicate of this bug. ***
Comment 16 Jeffrey Stedfast 2014-01-13 17:56:00 UTC
ok, so I've just fixed this in master.

might be too late to backport to 4.2.3, but if I am given the green light, I'll backport it.
Comment 17 Jeffrey Stedfast 2014-01-13 18:17:27 UTC
back ported to 4.2.3
Comment 18 chris 2014-01-13 18:20:57 UTC
thanks Jeffrey! could you also upload a build for testing?
Comment 19 Jeffrey Stedfast 2014-01-14 11:03:00 UTC
sure: https://files.xamarin.com/~jeff/XamarinStudio-
Comment 20 chris 2014-01-14 15:44:44 UTC
works here as well, thank you!
Comment 21 Jeffrey Stedfast 2014-01-14 16:50:12 UTC
Awesome, glad to hear this has solved the problem for you, Chris!
Comment 22 narayanp 2014-01-15 02:17:33 UTC
I have checked this issue with following builds:

X.S 4.2.3(build 3)
Mono 3.2.6

Now it is working fine. after build the project when user Run->Upload to device, it does not build project again.
This is Build Output: https://gist.github.com/atin360/8fb31e89f339121f3c49

This is output when Upload to device after build: https://gist.github.com/atin360/e979a85b176a1435c94b

Closing this issue
Comment 23 chris 2014-03-18 05:02:43 UTC
I am reopening the bug because after skipping the build it still signs the app and creates a new IPA file (current stable 4.2.3-60):

Building: Foo (Release)
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings

Building: Bar (AdHoc|iPhone)

Detecting signing identity...
Provisioning Profile: "Bar-adhoc" ([...])
Signing Identity: "iPhone Distribution: [...]"
App ID: "[...].com.Bar.a"
Performing main compilation...
Skipping project since output files are up to date
Build complete -- 0 errors, 0 warnings

Extracting embedded content

Updating debug configuration file

Updating debug settings manifest

Embedding provisioning profile

Processing entitlements file

Preparing resources rules

Signing application
codesign -v -f -s "[...]" "--resource-rules=/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar.app/ResourceRules.plist" --entitlements "/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar.xcent" "/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar.app"
/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar.app: replacing existing signature
/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar.app: signed bundle with Mach-O thin (armv7) [com.Bar.a]

Creating IPA archive
zip -r -y "/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar-1.0.0.ipa" Payload iTunesMetadata.plist
  adding: Payload/ (stored 0%)
  adding: Payload/Bar.app/ (stored 0%)
  adding: iTunesMetadata.plist (deflated 49%)
Saved IPA archive to '/Users/chris/prj/Bar/app/Bar/bin/iPhone/AdHoc/Bar-1.0.0.ipa'

---------------------- Done ----------------------

Build successful.
Comment 24 Jeffrey Stedfast 2014-10-29 16:24:07 UTC
Are you still able to reproduce this with 5.5.x?

Doesn't seem to happen for me.
Comment 25 chris 2014-10-30 05:43:00 UTC
Sorry but I gave up on Xamarin.
Comment 26 Udham Singh 2015-01-02 13:24:07 UTC
I have checked this issue with XS 5.7 (build 660) and observed that after building the project when user select option 'Run->Upload to device' it builds the project again before uploading on device.

Screencast : http://www.screencast.com/t/9O88Joh8

This is Build Output: https://gist.github.com/Udham1/c3e78f18987a576ccd2c
This is output when Upload to device after build:
Ide Log : https://gist.github.com/Udham1/b480e261c5d3757ec61a

Environment Info :

=== Xamarin Studio ===

Version 5.7 (build 660)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 7244769
Build date: 2014-12-11 14:54:30-0500

=== Build Information ===

Release ID: 507000660
Git revision: 6a74f9bdb90d9415b597064d815c9be38b401fee
Build date: 2014-12-18 00:38:00-05
Xamarin addins: 57be0f5e1433cb58b70ea9b52e9dc77ad791be40

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 27 Jeffrey Stedfast 2015-01-08 17:24:26 UTC
looks like all of the tasks were no-ops when you did "Upload to Device", so this problem seems fixed.