An assembly specified in the application dependencies manifest

原文地址:https://blog.csdn.net/lihongzhai/article/details/79039160

 

今天遇到了很奇怪的现象,在Windows上发布的asp.net core app部署到linux上就不好用了。提示如下错误:

Error: 
An assembly specified in the application dependencies manifest (Calculate24Web.deps.json) was not found: 
package: ‘Microsoft.AspNetCore.Antiforgery’, version: ‘2.0.1’ 
path: ‘lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.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.3.xml

把源码拷贝到Linux的机器上,可以编译,可以在开发模式下运行,(好像在Debug模式下还成功了),后来在Release模式下发布,就不能运行,提示上面的错误。

经过一天的倒腾,终于,最后,是个小问题。问题是asp.net 没有把服务器需要的包全部发布出来,它认为是目标系统带着有,而实际上目标系统中没有。解决办法:

增加如下一行到 csjproj文件中即可:<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> 
最后csjproj文件看上去像这个样子:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
  </PropertyGroup>

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值