首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Enable-Migrations命令出现错误

Enable-Migrations命令出现错误
EN

Stack Overflow用户
提问于 2017-09-14 13:50:49
回答 2查看 1K关注 0票数 0

我在ASP.Net样板框架上工作,现在我工作的地方不能使用那台机器,但我的谷歌驱动器上有备份。如何正确使用该备份?数据库创建、项目运行等?我在启用迁移和更新数据库命令时遇到错误

代码语言:javascript
复制
 Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///F:\Qubit 
 Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. 
(Exception from HRESULT: 0x80131515)"
At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:5
+     $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-P ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException

You cannot call a method on a null-valued expression.
 At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+     $dispatcher = $utilityAssembly.CreateInstance(
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

 Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///F:\Qubit 
 Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.dll' or one of its       dependencies. Operation is not supported. (Exception 
from HRESULT: 0x80131515)"
At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:5
+     $domain.CreateInstanceFrom(
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException
EN

回答 2

Stack Overflow用户

发布于 2017-09-14 14:32:46

使用包管理器,重新安装Entity Framework:

代码语言:javascript
复制
Uninstall-Package EntityFramework -Force

然后为每个项目安装它:

代码语言:javascript
复制
Install-Package EntityFramework

重新启动Visual Studio。

票数 1
EN

Stack Overflow用户

发布于 2017-09-14 23:35:50

您可以尝试:

以Administrator

  • Clean和Rebuild
  • Run VS
  • 删除obj文件夹

在某些情况下,您可以使用更新包-Reinstall来完成重新安装所有包

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46211485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档