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!

Antti K. Koskela

Antti Koskela is a proud digital native nomadic millennial full stack developer (is that enough funny buzzwords? That's definitely enough funny buzzwords!), who works as a Solutions Architect for Valo Intranet, the product that will make you fall in love with your intranet. Working with the global partner network, he's responsible for the success of Valo deployments happening all around the world.

He's been a developer from 2004 (starting with PHP and Java), and he's been bending and twisting SharePoint into different shapes since MOSS. Nowadays he's not only working on SharePoint, but also on .NET projects, Azure, Office 365 and a lot of other stuff.

This is his personal professional (e.g. professional, but definitely personal) blog.
mm

4
Leave a Reply

avatar
5000
2 Comment threads
2 Thread replies
3 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
Marcmmavinash Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
avinash
Guest
avinash

Thanks (sorry for wrong email). but you solved my issue. thanks a lot again.

Marc
Guest
Marc

Thanks for the work-around here. Also note that if you have more than just the start up project in your solution then you need to expand the post build copy command to copy more than just the one project’s dll. Tested with netcoreapp2.2 and EF 2.2.6.