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
MMG
  • 151
  • 1
  • 3
  • 13
  • check that there's this file: F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.Utility.dll – Alper Ebicoglu Sep 14 '17 at 05:57
  • Yes this file exist at given path. Now what to do with this? Sir @Alper – MMG Sep 14 '17 at 06:16

2 Answers2

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.

Alper Ebicoglu
  • 8,884
  • 1
  • 49
  • 55
  • check this topic for further information -> https://stackoverflow.com/questions/12318107/enabling-code-first-entity-framework-vs-web-express-2012/14994432#14994432 – Alper Ebicoglu Sep 14 '17 at 06:33
  • Sir @Alper this error occurred on installing entity-framework again File F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\install.ps1 cannot be loaded because running scripts is disabled on this system. – MMG Sep 14 '17 at 07:46
  • Sir @Alper "install.p‌​s1" – MMG Sep 14 '17 at 07:48
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

andmattia
  • 357
  • 6
  • 22