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

丶灬走出姿态 提交于 2019-11-30 00:37:49

Development machines usually have the SDK installed but on production the runtime only.

Add the following to your .csproj file and publish again.

<PropertyGroup>               
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

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:

And i solved it by downgrade all my Entityframework packages to 2.0.0 instead of the latest 2.2.0-preview one.

To solve the first half of the error message, An assembly specified in the application dependencies manifest (…) was not found be sure to always use the publish output when deploying to a target sever.

For a self-contained application it can be found in

bin\Release\netcoreapp2.0\win81-x64\publish

or for framework-dependent deployments in

bin\Release\netcoreapp2.0\publish

The output in the directories above are meant to be used in development only, since they are specific to machine and user configuration built with.

Taken from a related answer.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!