Entity Framework Core logo

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

Reading Time: 2 minutes.

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 an 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, while 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)

Table of Contents

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 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 – flip it to

  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:

Simple as that – you should be good.

References

mm
5 2 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments