【发布时间】:2016-01-04 05:30:34
【问题描述】:
我在关注getting started with EF 7 for UWP apps官方教程。
当我在 Add-Migration MyFirstMigration 时,它会抛出以下错误:
PM> Add-Migration MyFirstMigration
Add-Migration : Exception calling "CreateInstanceAndUnwrap" with "8" argument(s): "Could not load file or assembly 'AppShellProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
or one of its dependencies. An attempt was made to load a program with an incorrect format."
At line:1 char:1
+ Add-Migration MyFirstMigration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Migration], MethodInvocationException
+ FullyQualifiedErrorId : BadImageFormatException,Add-Migration
有人想出解决办法吗?
【问题讨论】:
-
它对我很有效。您是否在空白 UWP 应用项目中执行了完全相同的步骤?什么是 AppShellProject,您自己的项目还是通过 NuGet 获得的?你能在 project.json 中找到它吗?
-
@AlanYao-MSFT 我将目标更改为 x86(以前是 x64)并且它有效。谢谢,你拯救了我的一天和几周(我想学习 SQLite-Net)。我在查看 project.json 后进行了此更改。为什么它不适用于 x64?请将此添加为答案,以便我将问题标记为已解决:)
-
您可能遇到问题#1058。
标签: sqlite uwp entity-framework-core