.netcoreapp 发布到 linux 的问题,vs靠不住

Posted FreeSql & CSRedis

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了.netcoreapp 发布到 linux 的问题,vs靠不住相关的知识,希望对你有一定的参考价值。

.netcore 2.0 发布后,小版本更新速度惊人

截止目前:2.1.200

 

最新一个新项目,vs发布到[email protected]一直报错,反复发布n次依然失败。把本地2.1.100更新到最新2.1.200再次vs发布,依然失败。

[email protected]:/data/xxx# dotnet WebHost.dll

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly ‘System.IO.FileSystem, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a‘. The located assembly‘s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Aborted

 

最后使用命令行:dotnet publish --f netcoreapp2.0 -r linux-x64

上传后运行正常。

 

可能原因:dotnet小版本更新太快,vs没更新到最新小版本。也算是坑一个,错误信息太不明显。

以上是关于.netcoreapp 发布到 linux 的问题,vs靠不住的主要内容,如果未能解决你的问题,请参考以下文章