Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug] Xamarin.iOS build failed with Link Sdk Assembliies #332

Closed
albilaga opened this issue May 4, 2020 · 6 comments
Closed

[Bug] Xamarin.iOS build failed with Link Sdk Assembliies #332

albilaga opened this issue May 4, 2020 · 6 comments
Labels

Comments

@albilaga
Copy link

albilaga commented May 4, 2020

Hello. I am using this project in Xamarin.Forms project but the iOS project will always failed if we are using Linker Behavior set to Link Framework SDKs Only.
The error said
MTOUCH : error MT2002: Failed to resolve "System.Diagnostics.PerformanceCounter" reference from "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Here is the sample project
BulkExtTest.zip

@MartinLeist
Copy link

I have the same problem. This came with the update to a version for EFCore 3. I originally used EFCore 2 and an older version of EFCore.BulkExtensions. Since the Update I get the same error as the albilaga . This only is an issue with iOS and does not happen if setting the linker to Link All.

@MartinLeist
Copy link

After loading the code and looking for a solution, I found the reason for this issue. There is a reference to Microsoft.Data.SqlClient. After changing this back to System.Data.SqlClient like it was used in older builds, the project can be build on iOS again. I have also removed the GitHub Sourcelink NuGet, but I'm not sure if this was necessary.

@borisdj
Copy link
Owner

borisdj commented Sep 13, 2020

Microsoft.Data.SqlClient is newer, and advise is to use that one.
https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/

@MartinLeist
Copy link

I understand. I was in contact with Microsoft support about this and they and myself were looking through my project for around a week, but I got desktop dlls in my mobile app every time. The moment I changed the reference to System.Data.SqlClient the app worked again. Microsoft support could not tell me why that was the case. They suggested, Microsoft.Data.SqlClient was not fully compatible yet, but I wasn't able to find anything about that issue online.

For now my project works and I've had to change the code anyway to remove the FastMember usage. I'm not sure what would be the best way to address this, since I also read that Microsoft themselves recommend the new reference. Maybe when the BulkExtensions support removing of FastMember for mobile apps I can try around again and if the problem continues I can make a ticket to Microsoft about this.

@borisdj
Copy link
Owner

borisdj commented Sep 14, 2020

Yes, as already stated I plan to remove FastMember dependency.
Duplicate of: Library does not work on Xamari.iOS

@borisdj
Copy link
Owner

borisdj commented Apr 9, 2021

FastMember was removed but it seems that Microsoft.Data.SqlClient does not work on Xamarin - MonoAndorid (Sqlite), as stated in previously linked issue.
@MartinLeist Have you had any additional info from Microsoft support in the meantime.

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

No branches or pull requests

3 participants