Bug 12822 - Linker issues with ASMX web services
Summary: Linker issues with ASMX web services
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-21 12:14 UTC by Neal
Modified: 2013-06-21 13:14 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FEATURE

Description Neal 2013-06-21 12:14:59 UTC
Hello,

On the BETA channel testing async await implementation and using LINK ALL.  When doing so my ASMX web services don't work at all.  I recall seeing one warning or message during a compile about a linker issue with System.Web or System.Web.WebServices - can't remember and can't find it again.  Anyway, with LINK ALL the web services don't work, with Link SDK Assemblies it does.

FYI

P.S.  I've gone back to the stable channel as the app is crashing too much in the beta channel
Comment 1 Sebastien Pouliot 2013-06-21 13:14:22 UTC
That sounds normal. To use "Link all assemblies" you need to ensure that your own code preserve* its type/members that are used only thru reflection (because if they can't be found using static analysis the the linker will remove them). 

* This is identical to what Xamarin does on it's own (SDK) assemblies and why "Link SDK" works.

IOW you likely need to add some [Preserve] attributes on your types for "Link all assemblies" to work with web services (and/or WCF) since it's largely based on reflection. The linker automagically preserve the types with [Xml*] and [DataContract] attributes but that might not be enough for every application.

Note that this should be identical to using "Link all assemblies" with the stable version (if you want to try it again using the stable version). If not the please re-open the bug report with a self-contained test case so we can investigate why it differs.

p.s. please report crashers (along with stack traces) that you find using the beta channel. At some point, not too far away, the beta channel will become the new stable and, without bug reports, it could still contain the same issues you're presently facing.