找不到在应用程序依赖清单(...)中指定的程序集

编程入门 行业动态 更新时间:2024-10-28 04:22:12
本文介绍了找不到在应用程序依赖清单(...)中指定的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我将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文件中,然后再次发布。 / p>

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

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

更多推荐

找不到在应用程序依赖清单(...)中指定的程序集

本文发布于:2023-11-13 10:08:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   应用程序   清单   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!