question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found.

See original GitHub issue

Hello,

after last upgrade to VS 2017 (15.8.0) I can not create migration in my project. Script throw exception in packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783

Exception message: "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not 
found."
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : MissingMethodException

my command in Package manager Console is: EntityFramework\Add-Migration -StartUpProjectName "xxx" myMigrationName

Further technical details

EF version: 6.2 Database Provider: EntityFramework.SqlServer Operating system: Windows 10 (I upgrade to version 1803 one day before)

Thanks Pavel

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
rho24commented, Sep 14, 2018

The problem at least on my machine is that version 3.0.0.0 of the System.Management.Automation assembly is loaded in the package management console, and EntityFramework.PowerShell.Utility.dll is build against version 1.0.0.0.

I have a temporary fix of adding the following binding redirect to “C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\15.0_313c23f6\devenv.exe.config”

<dependentAssembly>
    <assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
    <publisherPolicy apply="no" />
</dependentAssembly>

Note, the fix needs to be applied everytime you update VS.

I was able to figure this out as its the same issue as this one https://github.com/PowerShell/PowerShell/issues/6189

Which i was also having, but was fixed in a recent VS update. Hopefully the fix they applied is easy for you too!

1reaction
divegacommented, Apr 8, 2019

It was reported in https://twitter.com/tore_aurstad/status/1115005326011641856?s=21 that this issue also repros on Visual Studio 2019.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception when trying to migrate database in Entity ...
PM> update-database Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.
Read more >
How to fix the entity framework problem with System.Data ...
How to fix the entity framework problem with System.Data.Entity.Migrations.Utilities.DomainDispatcher not found. After much searching and repair ...
Read more >
Entity Framework 6.2.0 scripting errors after upgrading to ...
Utilities.DomainDispatcher' not found." ... Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.
Read more >
Design-time DbContext Creation - EF Core
Using a constructor with no parameters. If the DbContext can't be obtained from the application service provider, the tools look for the derived ......
Read more >
Aviacion_Civil_Web - packages - EntityFramework.6.2.0
'System.Data.Entity.Migrations.ProjectTypeNotSupportedException' ... The 'entityFramework'. 24. section is added if it does not exist.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found