0

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 Answers2

1

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

Community
  • 1
  • 1
Skye Hoefling
  • 180
  • 1
  • 9
  • This helped me find the error. With the Entity Framework 6.2, it actually gave me the inner error that was occurring and I was able to resolve the issue. – David Brenchley Nov 03 '16 at 01:52
0

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

Ronan
  • 583
  • 5
  • 20