Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I have a cross-platform forms app which runs the following WCF code in the PCL without issue on WinPhone and Droid, but on iOS it throws a TypeInitializationException error. Looking at the parameters being passed in, the queryDevices parameter is shown as "System.TypeInitializationException: The type initializer for 'System.Data.Services.Client.TypeSystem' threw an exception."
IR_context = new IdentityServices.identityrelationships_dbEntities(svcUri);
DataServiceQuery<IdentityServices.Device> queryDevices = (DataServiceQuery<IdentityServices.Device>)(from device in IR_context.Devices where device.MAC == DeviceID select device);
// Begin query execution, supplying a method to handle the response
// and the original query object to maintain state in the callback.
Do you have the linker turned on for your iOS project? If so, does the problem persist with the linker turned off?
Are you referring to the iOS Build Linker Behavior of the project in VS?
(In reply to email@example.com from comment #2)
> Are you referring to the iOS Build Linker Behavior of the project in VS?
That seems to have worked. Thanks!!!
FMI, what does "not linking" do compared to "linking"?
Resolved. Thanks E.Z.
(In reply to firstname.lastname@example.org from comment #4)
> That seems to have worked. Thanks!!!
> FMI, what does "not linking" do compared to "linking"?
The linker removes unused code and libraries from your final application in order to produce a smaller application size.
In some cases, the linker is unable to determine whether or not particular code is used; this is a common issue when using reflection (which I'm guessing WCF is doing in this case). So by turning off the linker, you can fix your problem, but the downside is that your application ends up being much larger.
You probably don't want to disable linking entirely; rather, you probably want to tell the linker to leave some of your classes or assemblies alone. You can find information on the various ways to do this at https://developer.xamarin.com/guides/ios/advanced_topics/linker/
Thanks again E.Z. Will review and implement were appropriate.
Per "Linking on iOS - Don't Link"[https://developer.xamarin.com/guides/ios/advanced_topics/linker/], this should be treated as a bug to be resolved and reported.
Yes, we still need to determine why your code is being removed on iOS.
Can you provide a reproduction project?
Use the files provided for Bug 44152 - Lost Event Trigger Footprint
Checkout Bug 44152 - Lost Event Trigger Footprint. The project was provided for it.
The application provided with https://bugzilla.xamarin.com/show_bug.cgi?id=44152 doesn't seem to have an iOS project or contain any WCF code.
Try this solution sample: http://public.thoughts.net/Downloads/Sentry-iOS.zip
Assigned to you because bug you were last to resolve bug before it was re-opened.
Linked file in comment 14 results in a 404. Marking as NEEDINFO until that file is produced
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!