繁体   English   中英

Enable-Migrations命令给出错误

[英]Enable-Migrations Command giving Error

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

 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

使用程序包管理器,重新安装实体框架:

Uninstall-Package EntityFramework -Force

然后为每个项目安装它:

Install-Package EntityFramework

重新启动Visual Studio。

你可以试试:

  • 以管理员身份运行VS
  • 清理和重建
  • 删除obj文件夹

在某些情况下,您可以使用Update-Package -Reinstall完成重新安装所有软件包

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM