EntityFramework和Xamarin Forms .Net标准2.0程序集加载问题 [英] EntityFramework and Xamarin Forms .Net standard 2.0 Assembly Load issue

查看:110
本文介绍了EntityFramework和Xamarin Forms .Net标准2.0程序集加载问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

潜在的重复 EF.Core 2.0.1在Xamarin中不安全.Android 除了目标8.0不是7.1之外,而且还加载了dotnet版本2.1.4.

Potential DUPLICATE EF.Core 2.0.1 Unsafe in Xamarin.Android Except targeting 8.0 not 7.1 and dotnet version 2.1.4 is loaded.

使用VS 2017版本15.5.7测试 Xamarin表单中的实体框架 UWP项目.没有Mac来测试IOS版本.

Using VS 2017 version 15.5.7 to test Entity framework in Xamarin forms The UWP project. Dont have a mac to test the IOS version.

droid版本在以下输出中消失 proj.cs文件的关键点是

The droid version dies with the output below The key points from proj.cs file are

<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite">
  <Version>2.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="25.4.0.2" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="25.4.0.2" />

03-07 18:19:02.011 D/Mono(5003):装配加载程序探测 位置:"System.Runtime.CompilerServices.Unsafe". 03-07 18:19:02.011 F/monodroid-assembly(5003):无法加载组件 启动注册过程中的"System.Runtime.CompilerServices.Unsafe". 03-07 18:19:02.011 F/monodroid-assembly(5003):这可能是由于 无效的调试安装. 03-07 18:19:02.011 F/monodroid-assembly(5003):常见原因是"adb install" 应用程序,而不是通过IDE进行操作.

03-07 18:19:02.011 D/Mono ( 5003): Assembly Loader probing location: 'System.Runtime.CompilerServices.Unsafe'. 03-07 18:19:02.011 F/monodroid-assembly( 5003): Could not load assembly 'System.Runtime.CompilerServices.Unsafe' during startup registration. 03-07 18:19:02.011 F/monodroid-assembly( 5003): This might be due to an invalid debug installation. 03-07 18:19:02.011 F/monodroid-assembly( 5003): A common cause is to 'adb install' the app directly instead of doing from the IDE.

这个问题仍然没有解决吗? dev com post

Is this issue still not resolved ? dev com post

是否有一个适用于Net standard 2.0和Android 8.0的示例?

Is there a sample that works on Net standard 2.0 and Android 8.0?

推荐答案

我们遇到了同样的问题,它将解决此问题:

We had the same issue, this will resolve it:

  • 转到C:\ Users \您的用户名.nuget \ System.Runtime.Compilerservies.Unsafe \ 4.4.0 \并删除ref文件夹
  • 复制lib文件夹并将其重命名为ref
  • 清理并构建项目

这篇关于EntityFramework和Xamarin Forms .Net标准2.0程序集加载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆