Reputation: 37
Can anyone help me? I have an ASP.NET MVC project in Visual Studio 2022 running on .Net 4.6.1. I have a problem with Entity Framework.
PM> Enable-Migrations
System.BadImageFormatException: Could not load file or assembly 'EntityFramework, Culture=neutral, PublicKeyToken=null'. The module was expected to contain an assembly manifest.
File name: 'EntityFramework, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.Data.Entity.Tools.ReflectionExecutor..ctor(String assembly, String dataDirectory, String configurationFile, String rootNamespace, String language) in //src/ef6/ReflectionExecutor.cs:line 35
at System.Data.Entity.Tools.Commands.ProjectCommandBase.CreateExecutor() in //src/ef6/Commands/ProjectCommandBase.cs:line 85
at System.Data.Entity.Tools.Commands.MigrationsEnableCommand.Execute() in //src/ef6/Commands/MigrationsEnableCommand.cs:line 40
at System.Data.Entity.Tools.Commands.CommandBase. <>c__DisplayClass0_0.b__0() in //src/ef6/Commands/CommandBase.cs:line 28
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) in //src/ef6/CommandLineUtils/CommandLineApplication.cs:line 115
at System.Data.Entity.Tools.Program.Main(String[] args) in //src/ef6/Program.cs:line 40Could not load file or assembly 'EntityFramework, Culture=neutral, PublicKeyToken=null'. The module was expected to contain an assembly manifest.
??
Thank you for help
Upvotes: 0
Views: 203
Reputation: 1
Try using EntityFramework6\Enable-Migrations the cmdlet has been changed by Microsoft.
Upvotes: 0