centos運行netcore error:package: ‘Microsoft.AspNetCore.Antiforgery‘, version: ‘2.0.3‘


Error:
  An assembly specified in the application dependencies manifest (*.*.deps.json) was not found:
    package: ‘Microsoft.AspNetCore.Antiforgery‘, version: ‘2.0.3‘
    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.8.xml 

  原因:asp.net 沒有把服務器需要的包全部發布出來,它認為是目標系統帶着有,而實際上目標系統中沒有。
  解決辦法:增加如下一行到csjproj文件中即可

<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>

 

<PropertyGroup>
  <TargetFramework>netcoreapp2.0</TargetFramework>
  <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

  

 
        





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM