0
votes

add-migration v3_80 -ConnectionStringName MyMigrations yields me a serializationException Type is not resolved for member 'Autofac.Core.DependencyResolutionException,Autofac, Version=4.1.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da'

I have looked through solutions and there seem to be 2 known possibilities. One being an ampersand in a directory name and another being some of the projects being a different .Net version. I have verified I have no ampersands and all projects are version 4.6.1. Not sure where to go now to resolve this error.

Here is output with verbose PM> add-migration v3_80 -ConnectionStringName MyMigrations -Verbose Using StartUp project 'Nop.Plugin.Misc.HuntNBuddies'. Using NuGet project 'Nop.Plugin.Misc.HuntNBuddies'. System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Autofac.Core.DependencyResolutionException,Autofac, Version=4.1.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da'. at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner) at System.Data.Entity.Migrations.Design.ToolingFacade.Scaffold(String migrationName, String language, String rootNamespace, Boolean ignoreChanges) at System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges) at System.Data.Entity.Migrations.AddMigrationCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Type is not resolved for member 'Autofac.Core.DependencyResolutionException,Autofac, Version=4.1.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da'. PM>

2
could you try running the command with the -Verbose flag ? and edit your post with the complete log outputCyril Durand

2 Answers

1
votes

This error message is a known bug in Entity Framework and is fixed in 6.2. I have a workaround to figure out what is wrong that I answered here:

New embedded Firebird, code first, EF6 project results in SerializationException

0
votes

Try this

  • Go to nuget packet manager
  • go to consolidate tab
  • Consolidate all your packages to the correct version

Sometimes nuget packages target a different version making errors like this hard to solve. I hope this fixes it