我正在使用 Visual Studio 2019 Ent 和 EntityFramework.6.4.4。每当我重新启动我的 VS19 并访问 EF 时,它都会给我以下代码优先方法的错误。
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///("Project Name")\packages\EntityFramework.6.4.4\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. The
system cannot find the file specified."
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:782 char:5
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException
You cannot call a method on a null-valued expression.
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///"(Project Name)"\packages\EntityFramework.6.4.4\tools\EntityFramework.PowerShell.dll' or one of its dependencies. The system
cannot find the file specified."
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:811 char:5
+ $domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException
到目前为止我所尝试的:我找到了一个临时解决方案,通过每次重新安装 nugete 包即实体框架并且它可以工作。但这很烦人,绝对不是解决方案。寻找永久解决方案。提前致谢。