This post was most recently updated on February 26th, 2023.
2 min read.This post describes one no-brainer 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!
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 the red outline in the picture).
Maybe it really was the dependencies causing the project to be built, the build failing, and 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 reason, 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!
- How to solve keyboard shortcuts not working in Google Chrome on Windows? - September 10, 2024
- Search (and secretly, sync) broken in OneNote? A quick fix! - September 3, 2024
- “Destination Path Too Long” when copying files in File Explorer? Easy workaround(s)! - August 27, 2024