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
EF version: 6.2
Database Provider: EntityFramework.SqlServer
Operating system: Windows 10 (I upgrade to version 1803 one day before)
Thanks Pavel
I create new project with EF 6.2.0 and install log is not fine:
Attempting to gather dependency information for package 'EntityFramework.6.2.0' with respect to project 'ConsoleApp1', targeting '.NETFramework,Version=v4.7.1'
Gathering dependency information took 25,11 ms
Attempting to resolve dependencies for package 'EntityFramework.6.2.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'EntityFramework.6.2.0'
Resolved actions to install package 'EntityFramework.6.2.0'
Retrieving package 'EntityFramework 6.2.0' from 'nuget.org'.
Adding package 'EntityFramework.6.2.0' to folder 'D:\ConsoleAppEF\packages'
Added package 'EntityFramework.6.2.0' to folder 'D:\ConsoleAppEF\packages'
Added package 'EntityFramework.6.2.0' to 'packages.config'
Executing script file 'D:\ConsoleAppEF\packages\EntityFramework.6.2.0\toolsinstall.ps1'...
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.
DomainDispatcher' not found."
At E:\work_samples.net 4.7\ConsoleAppEF\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.
DomainDispatcher' not found."
At E:\work_samples.net 4.7\ConsoleAppEF\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
Type 'get-help EntityFramework' to see all available Entity Framework commands.
Successfully installed 'EntityFramework 6.2.0' to ConsoleApp1
Executing nuget actions took 1,97 sec
Time Elapsed: 00:00:02.0392469
========== Finished ==========
@kocka5 I followed the steps above on my machine, which has VS 15.8 and Windows 1803 and it worked fine. Some things to try:
I am having the same issue (originally in VS 15.8 and now in 15.8.2), and none of @ajcvickers suggestions solved the problem.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional>gacutil -l EntityFramework
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
Number of items = 0
I repaired the VS 2017 installation, rebooted, and was careful afterwards not to restore any of my custom settings or extensions.
I cleared my NuGet caches using Visual Studio twice: once as administrator and once as myself.

After all of these actions, the problem is still present when I attempt to update an Entity Framework database or even update the Entity Framework package itself.
PM> Update-Database -Verbose
Using StartUp project 'APAbID7'.
Using NuGet project 'APEngine'.
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.Entity.Migrations.MigrationsDomainCommand.WriteLine(String message)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Object reference not set to an instance of an object.
Arthur, do you have any other suggestions? I see that you marked my original bug report as an Entity Framework issue rather than a Visual Studio issue, but I'm still in a state where my only solution is to downgrade Visual Studio to 15.7.6. Is there any troubleshooting I can do from my end that might help isolate the problem?
@samalone Unfortunately, without being able to reproduce this I don't know what to suggest. Can you post the output from when you attempt to "update the Entity Framework package itself?"
Of course.
PM> Update-Package -Reinstall -ProjectName APEngine EntityFramework
Attempting to gather dependency information for multiple packages with respect to project 'APEngine', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 403.47 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'EntityFramework 6.2.0' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/entityframework/6.2.0/entityframework.6.2.0.nupkg
Removed package 'EntityFramework 6.2.0' from 'packages.config'
OK https://api.nuget.org/v3-flatcontainer/entityframework/6.2.0/entityframework.6.2.0.nupkg 132ms
Installing EntityFramework 6.2.0.
Successfully uninstalled 'EntityFramework 6.2.0' from APEngine
Package 'EntityFramework.6.2.0' already exists in folder 'C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages'
Added package 'EntityFramework.6.2.0' to 'packages.config'
Executing script file 'C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\install.ps1'
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
Type 'get-help EntityFramework' to see all available Entity Framework commands.
Successfully installed 'EntityFramework 6.2.0' to APEngine
Executing nuget actions took 9.68 sec
Time Elapsed: 00:00:10.2370310
After this, I decided to delete the EntityFramework.6.2.0 folder from the packages directory and try again. On re-opening my project in VS I got:

I clicked the Restore button and then tried my Update-Package command again, but got the same error as before.
It looks like the DomainDispatcher class is implemented in EntityFramework.PowerShell.Utility.dll, so the obvious explanation seems like the wrong version of that DLL is being loaded into the Package Manager Console. Can I modify the Entity Framework scripts or write a script of my own that would reveal what version of that DLL is being loaded and where it's being loaded from? (I'm a PowerShell novice, so I'm not sure how to go about writing such a script on my own.)
For what it's worth, I took a look at how EntityFramework.psm1 constructs a DomainDispatcher, and then attempted to reproduce those steps manually in the Package Manager Console. Curiously, all of the steps seem to work correctly when I execute them manually, even though they fail when I call Update-Database or Update-Package.
PM> $project = Get-Project APEngine
PM> echo $project
ProjectName Type FullName
----------- ---- --------
APEngine VB.NET C:\Users\samalone\Documents\Projects\antigen-plus-8.5\APEngine\APEngine\APEngine.vbproj
PM> $package = Get-Package -ProjectName $project.FullName | ?{ $_.Id -eq 'EntityFramework' }
PM> echo $package
Id Versions ProjectName
-- -------- -----------
EntityFramework {6.2.0} APEngine
PM> $componentModel = Get-VsComponentModel
PM> echo $componentModel
DefaultCatalog DefaultExportProvider DefaultCompositionService
-------------- --------------------- -------------------------
Microsoft.VisualStudio.Composition.NetFxAdapters+MefV1ExportProvider Microsoft.VisualStudio.Composition.NetFxAdapters+CompositionService
PM> $packageInstallerServices = $componentModel.GetService([NuGet.VisualStudio.IVsPackageInstallerServices])
PM> echo $packageInstallerServices
NuGet.VisualStudio.VsPackageInstallerServices
PM> $vsPackage = $packageInstallerServices.GetInstalledPackages() | ?{ $_.Id -eq $package.Id -and $_.Version -eq $package.Version }
PM> echo $vsPackage
Id : EntityFramework
Version : 6.2.0
VersionString : 6.2.0
Title :
Authors : {}
Description :
InstallPath : C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0
PM> $installPath = $vsPackage.InstallPath
PM> echo $installPath
C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0
PM> $toolsPath = Join-Path $installPath tools
PM> echo $toolsPath
C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools
PM> $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $toolsPath EntityFramework.PowerShell.Utility.dll))
PM> echo $utilityAssembly
GAC Version Location
--- ------- --------
False v4.0.30319 C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\EntityFramework.PowerShell.Utility.dll
PM> $dispatcher = $utilityAssembly.CreateInstance('System.Data.Entity.Migrations.Utilities.DomainDispatcher', $false, [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::Public, $null, $PSCmdlet, $null, $null)
PM> echo $dispatcher
System.Data.Entity.Migrations.Utilities.DomainDispatcher
PM>
@samalone Can you zip up and post the project/solution?
I resolve, that problem is in $PSCmdlet parameter, becuase:
PM> $ToolsPath = 'C:\Users\kocar.TREX.nuget\packages\entityframework\6.2.0\tools'
PM> $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
PM> $dispType = $utilityAssembly.GetType('System.Data.Entity.Migrations.Utilities.DomainDispatcher')
PM> $dispType.GetConstructors([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::Public).Count
last command return two
But if I change EntityFramework.psm1 (line 783) to :
$utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
Write-Host $ToolsPath
Write-Host $utilityAssembly
$dispType = $utilityAssembly.GetType('System.Data.Entity.Migrations.Utilities.DomainDispatcher')
Write-Host $dispType.GetConstructors([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::Public).Count
this print:
EntityFramework.PowerShell.Utility, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
1
in script found only 1 parameter less constuctor!!!!
Pavel
@ajcvickers I can't post my main project, but it was easy to reproduce the problem with a sample project, attached below. All I had to do to get my first error was:
Install-Package EntityFrameworkPM> Install-Package EntityFramework
Attempting to gather dependency information for package 'EntityFramework.6.2.0' with respect to project 'EFTest', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 23.12 ms
Attempting to resolve dependencies for package 'EntityFramework.6.2.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'EntityFramework.6.2.0'
Resolved actions to install package 'EntityFramework.6.2.0'
Retrieving package 'EntityFramework 6.2.0' from 'nuget.org'.
Adding package 'EntityFramework.6.2.0' to folder 'C:\Users\samalone\Documents\Projects\EFTest\packages'
Added package 'EntityFramework.6.2.0' to folder 'C:\Users\samalone\Documents\Projects\EFTest\packages'
Added package 'EntityFramework.6.2.0' to 'packages.config'
Executing script file 'C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools\install.ps1'
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
Type 'get-help EntityFramework' to see all available Entity Framework commands.
Successfully installed 'EntityFramework 6.2.0' to EFTest
Executing nuget actions took 2.65 sec
Time Elapsed: 00:00:02.9095676
I get the same error when I type Update-Database in the Package Manager Console.
Inspired by @kocka5, I tried editing EntityFramework.psm1 and was surprised to find that it is loading EntityFramework.PowerShell.Utility.dll from the correct location. I changed the function New-DomainDispatcher to read:
function New-DomainDispatcher($ToolsPath)
{
Write-Host $ToolsPath
$utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path $ToolsPath EntityFramework.PowerShell.Utility.dll))
Write-Host $utilityAssembly
Write-Host $utilityAssembly.Location
$dispType = $utilityAssembly.GetType('System.Data.Entity.Migrations.Utilities.DomainDispatcher')
$constructors = $dispType.GetConstructors([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::Public)
Write-Host $constructors
Write-Host $constructors.Count
$dispatcher = $utilityAssembly.CreateInstance(
'System.Data.Entity.Migrations.Utilities.DomainDispatcher',
$false,
[System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::Public,
$null,
$PSCmdlet,
$null,
$null)
return $dispatcher
}
And the output from Update-Database is:
PM> Update-Database
C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools
EntityFramework.PowerShell.Utility, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools\EntityFramework.PowerShell.Utility.dll
Void .ctor() Void .ctor(System.Management.Automation.PSCmdlet)
2
Exception calling "CreateInstance" with "7" argument(s): "Constructor on type 'System.Data.Entity.Migrations.Utilities.DomainDispatcher' not found."
At C:\Users\samalone\Documents\Projects\EFTest\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:790 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : MissingMethodException
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.Entity.Migrations.MigrationsDomainCommand.WriteLine(String message)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Object reference not set to an instance of an object.
The path to EntityFramework.PowerShell.Utility.dll looks correct to me, but the constructor cannot be found.
I've included my modified version of EntityFramework.psm1 in the sample project.
@kocka5 @samalone I still can't reproduce this on any of my machines. Can you post the PowerShell version that the PMC is using? For example:
PM> $psversiontable.psversion
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 228
@ajcvickers My version is the same.
PM> $psversiontable.psversion
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 228
I have no idea if this is helpful, but I decided to debug one copy of Visual Studio with another so I could trace the module loads and unloads while the Update-Database script runs. It seems noteworthy that EntityFramework.PowerShell.Utility.dll is loaded from two different locations:
Is it normal for a copy of EntityFramework to be stashed away in the %LOCALAPPDATA% folder?
Here's the complete log:
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'ComSnippets'.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'System.Management.Automation.ComInterop.DynamicAssembly'.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.DependencyResolver.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\StanCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Diagnostics.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.DeveloperTools.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\StanPackage.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.CodeAnalysis.Sdk.UI.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Domain 3): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Platform.AppDomainManager.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\samalone\Documents\Projects\antigen-plus-8.5\packages\EntityFramework.6.2.0\tools\EntityFramework.PowerShell.Utility.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\38e369b7\00c4f480_224cd301\EntityFramework.PowerShell.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\70c2b8cf\00c4f480_224cd301\EntityFramework.PowerShell.Utility.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\assembly\GAC\EnvDTE\8.0.0.0__b03f5f7f11d50a3a\EnvDTE.dll'. Module was built without symbols.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\1d60e937\0097c37f_224cd301\EntityFramework.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.OLE.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.OLE.Interop.dll'. Module was built without symbols.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.Shell.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Interop.dll'. Module was built without symbols.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Interop\Microsoft.VisualStudio.Shell.Interop.8.0.dll'. Module was built without symbols.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Shell.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Migrations): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Domain 4): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'devenv.exe' (CLR v4.0.30319: Domain 4): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'devenv.exe' (CLR v4.0.30319: Domain 3): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Platform.AppDomainManager.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\38e369b7\00c4f480_224cd301\EntityFramework.PowerShell.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\70c2b8cf\00c4f480_224cd301\EntityFramework.PowerShell.Utility.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\assembly\GAC\EnvDTE\8.0.0.0__b03f5f7f11d50a3a\EnvDTE.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Users\samalone\AppData\Local\assembly\dl3\Q8PCLGJL.DVV\BMZNDLH5.NM5\1d60e937\0097c37f_224cd301\EntityFramework.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.OLE.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.OLE.Interop.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\assembly\GAC\Microsoft.VisualStudio.Shell.Interop\7.1.40304.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.Interop.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Interop\Microsoft.VisualStudio.Shell.Interop.8.0.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Shell.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'
'devenv.exe' (CLR v4.0.30319: Migrations): Unloaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'
'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Text.RegularExpressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Text.RegularExpressions.dll'. Module was built without symbols.
@samalone I think that's just the location for "shadow copies" of the assemblies used when the app-domain for tooling is created.
I have also been experiencing this issue @ my work location. So I feel the frustration of @samalone & @kocka5.
In my home environment all is working as expected, so I can confirm when @ajcvickers says he cannot reproduce it.
Both environments are running VS2017 8.2.
Tried my project in both environments using EF 6.2
Created new projects in both environments using EF 6.1.3 and 6.2
That's my pitch for the boss to work at home.
I just tried creating a new Windows user account, and that gets the same error. So the source of the problem must be system-wide rather than in my personal account.
I guess the next things I'll try are:
OK, good news (of a sort). Resetting Windows and then reinstalling Visual Studio has solved the problem.
Now to reinstall my other developer tools...
Anything new on this?? This is killing me
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!
@rho24 - That seems to have worked! THANKS!!!!!
@rho24 thanks this fixed the problem.
Has anyone actually solved this issue without workarounds?
It was reported in https://twitter.com/tore_aurstad/status/1115005326011641856?s=21 that this issue also repros on Visual Studio 2019.
@bricelam Would the tooling changes have had any implications for this issue?
Yes, most of the code mentioned here is gone.
Most helpful comment
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"
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!