Let's fix all the problems!

Fixing “An assembly specified in the application dependencies manifest [projectname].deps.json was not found”

This post was most recently updated on February 17th, 2019.

Reading Time: 2 minutes.

This post describes one nobrainerish fix to the error “An assembly specified in the application dependencies manifest [projectname].deps.json was not found.” I ran into this while running Update-Database for my ASP.NET Core web project, that’s using EntityFrameworkCore 2.1.1.

I hadn’t seen this one before, but the error was quite interesting:

Error:
   An assembly specified in the application dependencies manifest (Koskila.[projectname].AzureFunctions.deps.json) was not found:
     package: 'Koskila.[projectname].AzureFunctions', version: '1.0.0'
     path: 'Koskila.[projectname].AzureFunctions.dll'

Well that’s a weird one coming from an update-database command!

Running Update-Database in the terminal for an ASP.NET MVC Core project with Entity Framework Core.
Running Update-Database in the terminal for an ASP.NET MVC Core project with Entity Framework Core.

I quickly realized, that the project name in the error didn’t match my web project. That was odd, since I had selected the web project to run my commands against (see red outline in the picture).

The Update-Database command ran into an error: "An assembly specified in the application dependencies manifest [projectname].deps.json was not found."
The Update-Database command ran into an error: “An assembly specified in the application dependencies manifest [projectname].deps.json was not found.”

Maybe it really was the dependencies causing the project to be built, the build failing, and that messing up the Update-Database command? After all, if the Azure Functions project did not reference the EntityFrameworkCore package.

Nope – the project would build just fine. It was just the commandlet failing. That’s peculiar..

Solution

Well, this one was fairly straightforward. For whatever reasons, sometimes you do need to specify -ProjectName with the commandlet.

Just selecting the default project in the dropdown and as the startup project is not always enough. I don’t recall having exactly this issue with (non-Core) Entity Framework in the past, so maybe this is something that’s only there in the later versions?

Why? I don’t know, but at least it does make sense to be verbose with your commands, so this isn’t such a drag :)

So, in short, if you get this error with Add-Migration, Update-Migration or Remove-Migration, check these:

  • You have selected the right default project in the dropdown in the Package Manager Console (usually your web project)
  • You have selected that same project as your startup project in your solution explorer
  • If you still get the error, also add -Project or -ProjectName, referencing your web project.

With this, you should be good!

mm
0 0 vote
Article Rating
Subscribe
Notify of
guest
4 Comments
most voted
newest oldest
Inline Feedbacks
View all comments