Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library does not work on Xamarin.iOS #320

Closed
AlexanderPBrown opened this issue Apr 14, 2020 · 4 comments
Closed

Library does not work on Xamarin.iOS #320

AlexanderPBrown opened this issue Apr 14, 2020 · 4 comments
Labels

Comments

@AlexanderPBrown
Copy link

Use of FastMember does not allow deployment to Xamarin.iOS prod builds. For some reason it works in the emulator and when in Debug mode for me, but the Staging builds yield a runtime error.

FastMember library mentions that it does not support AOT environments like Xamarin.iOS. Is it possible to detect these environments and avoid using this library in these cases? Alternatively, some documentation clarifying that these libraries cannot be used on Xamarin.iOS so that people don't waste their time and find out in staging test environment?

  • Alex P. Brown
Stack Trace:
Inner Exception: 
System.PlatformNotSupportedException:Operation is not supported on this platform.
Stack Trace:  at FastMember.TypeAccessor.CreateNew (System.Type type, System.Boolean allowNonPublicAccessors) <0x106cd1370 + 0x00890> in <798736fc01fd469ca61008d61c3c942a#c98189853e6325ad5bb6252eaaf8d71d>:0 
  at FastMember.TypeAccessor.Create (System.Type type, System.Boolean allowNonPublicAccessors) <0x106ccfc40 + 0x00153> in <798736fc01fd469ca61008d61c3c942a#c98189853e6325ad5bb6252eaaf8d71d>:0 
  at EFCore.BulkExtensions.SqlBulkOperation.MergeAsync[T] (Microsoft.EntityFrameworkCore.DbContext context, System.Collections.Generic.IList`1[T] entities, EFCore.BulkExtensions.TableInfo tableInfo, EFCore.BulkExtensions.OperationType operationType, System.Action`1[T] progress, System.Threading.CancellationToken cancellationToken) <0x106c7d360 + 0x0270b> in <e45217439afa41d8804137c627dc3352#c98189853e6325ad5bb6252eaaf8d71d>:0 
  at SHISessionScanner.Core.Services.CventEventSyncService.bulkEventDetailsDbSync (System.Guid eventGuid, SHISessionScanner.Model.CventEvent eventDetails) <0x1068066c0 + 0x00777> in <284699bca45b4d6e9f01c9b88ffb8c45#c98189853e6325ad5bb6252eaaf8d71d>:0 
  at SHISessionScanner.Core.Services.CventEventSyncService.syncDownloadWithDatabase (System.Guid eventGuid, SHISessionScanner.Model.CventEvent eventDetails) <0x106805d00 + 0x0033b> in <284699bca45b4d6e9f01c9b88ffb8c45#c98189853e6325ad5bb6252eaaf8d71d>:0 
@borisdj
Copy link
Owner

borisdj commented Apr 14, 2020

FastMember library is not necessary, there are situations where it is not used, for example with OwnedTypes DataTable is used instead of library FastMember since it does not work in that case.
So this would be similar situation and usage of FM library can be configured in BulkConfig with property UseOnlyDataTable.

bool useFastMember = tableInfo.HasOwnedTypes == false // With OwnedTypes DataTable is used since library FastMember can not (https://github.com/mgravell/fast-member/issues/21)
&& tableInfo.ColumnNameContainsSquareBracket == false // FastMember does not support escaped columnNames ] -> ]]
&& tableInfo.ShadowProperties.Count == 0 // With Shadow prop. Discriminator (TPH inheritance) also not used because FastMember is slow for Update (https://github.com/borisdj/EFCore.BulkExtensions/pull/17)
&& !tableInfo.ConvertibleProperties.Any() // With ConvertibleProperties FastMember is slow as well
&& !tableInfo.HasAbstractList // AbstractList not working with FastMember
&& !tableInfo.BulkConfig.UseOnlyDataTable;

@borisdj borisdj closed this as completed Apr 14, 2020
@borisdj
Copy link
Owner

borisdj commented Apr 14, 2020

I have added Remark about it in the ReadMe.

@MartinLeist
Copy link

On Xamarin.iOS one usually uses SQLite. The SQLite path uses FastMember no matter what. The way without fastmember is only included on SQL Server. So the cominbation Xamarin.iOS and SQLite does not work.

@borisdj
Copy link
Owner

borisdj commented Sep 17, 2020

FastMember dependency is now removed.
Version 3.2.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants