Problem “Could not load file or assembly ’<assembly>’ or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)" when using Entity Framework’s migrate.exe
Could not load file or assembly ’
’ or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
That’s nice, but nothing special, right? The reason is simple and as lot of magic execution errors it is current/working directory related. To fix it, simply explicitly specify path (relative works) to your assembly using
StartUpDirectory parameter. And there’s another one gotcha. This parameter works only with
:. Let me explain.
migrate.exe /StartUpDirectory C:\Foo\Bar\Baz
Doesn’t work (and no error). But this one.
Hope it saves you some time hunting what’s wrong.