当我试图通过Visual Studio2015更新3中的NuGet 3.5.0将Dapper.net 1.50.2安装到UWP5.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": {}
}
}发布于 2016-09-12 18:10:23
如果您不需要执行查询并将其映射到动态对象列表,则可以在UWP应用程序中使用Entity framework 7。
恐怕Dapper.Net现在不能用于UWP应用程序,UWP应用程序使用COM作为基础,并不是所有基于.Net的库都可以在UWP应用程序中使用。您可以尝试将其封装到WCF服务中并从该服务中获取值,或者您可以尝试创建一个可移植的库(类库( portable ))来为您的应用程序实现此库。
或者您可以尝试使用web API /服务来解决您的问题,例如,您可以将数据提交到web API,web API使用dapper从您的数据库获取数据并将其传递回您的应用程序。
https://stackoverflow.com/questions/39403691
复制相似问题