无法将Dapper.net 1.50.2安装到UWP 5.2.2应用程序

时间:2016-09-09 04:04:14

标签: uwp dapper

当我尝试通过Visual Studio 2015更新3中的NuGet 3.5.0将Dapper.net 1.50.2安装到UWP 5.2.2应用程序时出现以下错误。任何人都知道为什么以及如何修复它?

Restoring packages for 'UI'.
Restoring packages for C:\Projects\2016\UWP\UI\project.json...
System.Reflection.Emit.Lightweight 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.Lightweight on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-arm-aot).
System.Reflection.Emit.Lightweight 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.Lightweight on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x64-aot).
System.Reflection.Emit.Lightweight 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.Lightweight on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
System.Reflection.Emit.ILGeneration 4.0.1 provides a compile-time reference assembly for System.Reflection.Emit.ILGeneration on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x86-aot).
Package restore failed for 'CadWeb.UI'.
Package restore failed. Rolling back package changes for 'UI'.
========== Finished ==========
Time Elapsed: 00:00:02.5165403

以下是project.json

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

1 个答案:

答案 0 :(得分:0)

如果您不需要执行查询并将其映射到动态对象列表,则可以在UWP应用中使用Entity framework 7

我担心Dapper.Net现在不适用于UWP应用程序,UWP应用程序使用COM作为基础,并非基于.Net的所有库都可以在UWP应用程序中使用。您可以尝试将此包装到WCF服务中并从此服务获取值,或者您可以尝试创建一个可移植的库(类库(可移植)),为您的应用程序实现此库。

或者您可以尝试使用Web API /服务来解决您的问题,例如您可以将数据提交到Web API,Web API使用dapper从您的数据库中获取数据并将其传递回您的应用程序。