Enable-Migrations Command giving Error

0

I was working on ASP.Net boilerplate framework and now that machine is not available where i was working, But i have backup on my Google drive. How i can use that backup properly? Database creation , project running etc??? I am getting error on Enable-Migrations and Update Database Commands

 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
c#
entity-framework
entity-framework-migrations
aspnetboilerplate
asp.net-boilerplate
asked on Stack Overflow Sep 14, 2017 by MMG

2 Answers

1

Using the Package Manager, re-install Entity Framework:

Uninstall-Package EntityFramework -Force

Then install it for each project:

Install-Package EntityFramework

Restart Visual Studio.

answered on Stack Overflow Sep 14, 2017 by Alper Ebicoglu
1

You can try:

  • Run VS as Administrator
  • Clean & Rebuild
  • Remove the obj folder

In some case you can use Update-Package -Reinstall to complete reinstall all package

answered on Stack Overflow Sep 14, 2017 by andmattia

User contributions licensed under CC BY-SA 3.0