Bug 11885 - Xamarin Studio doesn't persist changes to Link All Assemblies
Summary: Xamarin Studio doesn't persist changes to Link All Assemblies
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Mikayla Hutchinson [MSFT]
: 9127 ()
Depends on:
Reported: 2013-04-22 11:03 UTC by jesse.attas
Modified: 2013-07-23 09:50 UTC (History)
4 users (show)

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

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 jesse.attas 2013-04-22 11:03:19 UTC
Sometimes when I change the Android Link All Assemblies setting in the project properties, it is not persisted to the project file.

1) Create a new solution from the Android Application template.
2) Double-click the top-level project to show its properties.
3) Navigate to Build>>Android Build.
4) Change the configuration to Release.
5) Change the linker behavior to Link All Assemblies.
6) Wait for it to save, then open the csproj in a text editor. Search for "AndroidLinkMode". It will not appear under the Release section, even though the default is Link SDK Assemblies.
Comment 1 jesse.attas 2013-05-02 11:19:15 UTC
This bug is even worse than I originally reported. If I build and run a project that has <LinkMode>Full</LinkMode> (which I set in VS or a text editor), XS on Mac will remove that line and build with the default LinkMode (SdkOnly). So there seems to be no way to use the Link All Assemblies from XS!

The behavior is somewhat intermittent. I was able to build and run with LinkAll once, but the next time I ran it rebuilt and stripped it out.

Furthermore, XS and VS have different behaviors when you change this setting from the project properties dialog. VS adds these additional attributes if I set LinkMode to Full:
    <AndroidLinkSkip />
If they're important in one IDE then probably both IDEs should add them. It looks like XS doesn't strip these attributes out, but they're not sufficient to cause Link All to work.
Comment 2 Mikayla Hutchinson [MSFT] 2013-05-02 19:33:15 UTC
Unfortunately it looks like the default value for LinkMode was changed in the targets without updating Xamarin Studio. Jon, can we please avoid doing this in future?

The additional attributes added by VS are mostly not a problem, it's just setting them to the default values. Wheareas XS omits properties with the default values. The exception is EmbedAssembliesIntoApk. XS cannot handle the default value correctly because of a bug in the targets, bug 12083.
Comment 3 Mikayla Hutchinson [MSFT] 2013-05-03 20:45:22 UTC
Fixed default and added workaround for  bug 12083.
Comment 4 Mikayla Hutchinson [MSFT] 2013-06-27 18:05:42 UTC
*** Bug 9127 has been marked as a duplicate of this bug. ***
Comment 5 narayanp 2013-07-22 08:26:33 UTC
Today we have checked this issue with following builds:

X.S 4.0.10(build 7)
Mono 3.1.2
Xamarin.Android 4.8.0-13

We have followed the steps and observed that after creating android application when we select platform as Release and select Link All in Build->Android Build and open .csproj file in text editor we are seeing <AndroidLinkMode>Full</AndroidLinkMode> this is the screencast for the same: http://screencast.com/t/WpJmb1UwM and we are successfully able to build and deploy application.

Please let us know is this correct step[s which we have followed to verify this issue? so that we can close this issue
Comment 6 jesse.attas 2013-07-23 09:50:16 UTC
Those steps look correct. Thanks!