Entity Framework Core logo

“An assembly specified in the application dependencies manifest was not found” when running Add-Migration in Entity Framework Core?

This post was most recently updated on September 25th, 2021.

2 min read.

Another quick one – I’m sure this doesn’t apply to all cases, but I’m still logging it in case someone (like myself) stumbles upon the issue and finds help here.

I was building a solution with some Azure Functions fetching and populating data in a database, and was planning on building a UI for browsing the data at some point later on – but I actually got stuck on the second step already :)

While adding the database to my project, and running Add-Migration in Entity Framework Core, I stumbled upon this error:

Error:
An assembly specified in the application dependencies manifest (ContosoProject.Functions.deps.json) was not found:
package: 'ContosoProject.Data', version: '1.0.0'
path: 'ContosoProject.Data.dll'

Solution(s)

I was using .NET Core 3.1 – but you could probably run into this on other versions as well. I’m guessing the same fix should work – it’s a more general tooling issue after all :)

Verify the following things, and with any luck, you’re good:

Time needed: 2 minutes

How to resolve the issue “An assembly specified in the application dependencies manifest was not found”?

  1. Change your target project to be the project that contains your database context file(s).

    This step presumes you’re running the commandlet from the Package Manager Console. It has a dropdown for the Default project

    How to change the Default Project in the Package Manager Console in Visual Studio?

  2. Change your startup project to be the project that contains your database files

    This is the step I always fail at :) Not only does your “data project” (or whatever project is holding the database context, again) need to be the “Default project”, it also needs to be the Startup project of your solution.

    You can set it by clicking said project using the right mouse button and selecting “Set as Startup Project” – see below:

    How to set a Startup Project in Visual Studio?

Simple as that – you should be good.

References

mm
5 2 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
most voted
newest oldest
Inline Feedbacks
View all comments