我有一个asp.net core应用程序。我将项目发布到文件夹,然后将文件同步到Linux生产服务器。
所有asp.net core 1.x版本都能很好地运行。
升级到2.0版本后,使用Microsoft.AspNetCore.All元包,asp.net core依赖项未发布到输出。我使用debian-x64创建了自包含的发布,但没有任何变化。
Linux服务器不应访问互联网,因此无法下载依赖项。
如何在发布的文件中包含所有依赖项?
所有asp.net core 1.x版本都能很好地运行。
升级到2.0版本后,使用Microsoft.AspNetCore.All元包,asp.net core依赖项未发布到输出。我使用debian-x64创建了自包含的发布,但没有任何变化。
Linux服务器不应访问互联网,因此无法下载依赖项。
如何在发布的文件中包含所有依赖项?
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
即使发布了一个空的控制台应用程序,我仍然会遇到这个错误。 - Alirezadotnet new console && dotnet run
) - Martin Ullrich