An assembly specified in the application dependencies manifest (…) was not found

前端 未结 9 517
长发绾君心
长发绾君心 2020-12-23 16:38

I upgraded Microsoft.AspNetCore from 2.0.3 to 2.0.5 and my WebAPI project, although running successfully locally, fails to start in production (IIS). Everything was fine in

相关标签:
9条回答
  • 2020-12-23 16:49

    2 cents: If you just take from the build folder, the dlls for the dependency aren't provided. If you publish the folder, they are. This was the fix for me.

    0 讨论(0)
  • 2020-12-23 16:49

    I had this error however my solution was somewhat different from what was posted above. My problem was that I was deploying via a zip file and while building the zip file I wasn't including sub directories therefore required files were not being included.

    So if you are publishing via a zip file make sure to include all sub folders while building the zip.

    0 讨论(0)
  • 2020-12-23 16:50

    If you have more than one project in your solution like me:

    and if you want to scaffold dbcontext in your "non startup" project (InstantOrder.Functions.Data in my case) then you should add the -StartupProject parameter of the Scaffold-DbContext command like this -

    Scaffold-DbContext "Server=..." -Project InstantOrder.Functions.Data -StartupProject InstantOrder.Functions.Data 
    
    0 讨论(0)
  • 2020-12-23 16:51

    I got this error while running Scaffold-DbContext command on the Library project.

    Solution:

    1. Remove the Azure Function project from the solution, and then run this command.
    2. After that, use add an existing project feature to add the Azure Function project again in the solution.
    0 讨论(0)
  • 2020-12-23 16:54

    Sometimes this is related to the Startup Project, For example if the migration is a class library in Azure Functions project. You have to make sure when you run Add-Migration while the EF Library project is selected as Startup Project.

    0 讨论(0)
  • 2020-12-23 16:59

    For me, the marked answer didn't solve the issue. My issue was when trying to Add-Migration

    Add-Migration -Name initial-migration -Context Mysln.Data.MyDbContext -StartupProject Mysln -Project Mysln.Core
    

    And the error was like this:

    I solved it by downgrading all my Entityframework packages to 2.0.0 instead of the latest 2.2.0-preview one.

    0 讨论(0)
提交回复
热议问题