未找到应用程序依赖项清单 (...) 中指定的程序集 [英] An assembly specified in the application dependencies manifest (...) was not found

查看:53
本文介绍了未找到应用程序依赖项清单 (...) 中指定的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Microsoft.AspNetCore 从 2.0.3 升级到 2.0.5,我的 WebAPI 项目虽然在本地成功运行,但无法在生产环境 (IIS) 中启动.在这次升级之前,生产中的一切都很好.日志目录中产生的错误信息如下:

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 production until this upgrade. The error message produced in the log directory is as follows:

Error:
  An assembly specified in the application dependencies manifest (MyProject.WebAPI.deps.json) was not found:
    package: 'Microsoft.AspNetCore.Mvc.Abstractions', version: '2.0.2'
    path: 'lib/netstandard2.0/Microsoft.AspNetCore.Mvc.Abstractions.dll'

  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.5.xml

有人可以向我解释一下这到底是什么意思吗?我认为这是某种版本不匹配,但为什么会发生这种情况?我认为 NuGet 包的最新稳定版本不应该有这样的问题.

Could someone explain to me the details of exactly what this means? I assume it's a version mismatch of sorts, but why is this occurring? I thought the latest stable releases of NuGet packages weren't supposed to have such issues.

我能够通过将 Microsoft.AspNetCore.All 从 2.0.5 降级到 2.0.3 来解决该问题,但想找到一个更好的解决方案,以便我可以使用最新版本的这个包.

I was able to resolve the issue by downgrading Microsoft.AspNetCore.All from 2.0.5 to 2.0.3, but would like to find a better solution to the issue so I can use the most up-to-date version of this package.

推荐答案

开发机器通常安装了 SDK,但在生产环境中只有运行时.

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

将以下内容添加到您的 .csproj 文件并再次发布.

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

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

这篇关于未找到应用程序依赖项清单 (...) 中指定的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆