EF.Core 2.0.1 Unsafe in Xamarin.Android

大城市里の小女人 提交于 2019-12-10 17:03:40

问题


I'm not sure what to do about this. Any suggestions?

Deployment Exception

D/Mono (12535): Assembly Loader probing location: 'System.Runtime.CompilerServices.Unsafe'.

F/monodroid-assembly(12535): Could not load assembly 'System.Runtime.CompilerServices.Unsafe' during startup registration.

F/monodroid-assembly(12535): This might be due to an invalid debug installation.

F/monodroid-assembly(12535): A common cause is to 'adb install' the app directly instead of doing from the IDE.

Repro

Visual Studio 2017 (Version 15.5.7)

1) Create a new Cross-Platform App (Xamarin.Forms)

2) Pick Blank App, uncheck iOS, Windows but leave Android checked.

3) Pick Xamarin.Forms and .NET Standard

4) Run this without doing anything more from Visual Studio to an Android 7.x phone or Emulator (such as, Android_Accelerated_Nougat (Android 7.1 - API 25))

See: It deploys and runs just fine

5) Add Microsoft.EntityFramework.Core v2.0.1 from NuGet to the NET Standard project.

6) Run this without doing anything more using the same deployment target.

See: The Deployment Exception

  • I've also tried updating to the newest Xamarin NuGets but it doesn't affect the result.

  • I also tried these ideas https://developercommunity.visualstudio.com/content/problem/152947/xamarin-android-run-error-could-not-load-assembly.html

The most promising answer says we need to roll back to package.config but I don't know how to do that in this latest version of Visual Studio.

What is responsible for this bug? EF Core or Xamarin?

来源:https://stackoverflow.com/questions/48956433/ef-core-2-0-1-unsafe-in-xamarin-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!