【发布时间】:2021-04-08 05:02:27
【问题描述】:
以下是我的服务器环境
- 服务器:VPS
- 主机:AWS EC2
- 操作系统:CentOS Linux 8.3.2011
- Plesk:Plesk 黑曜石 18.0.34
- .Net 版本:.Net Core 3.1.11(从 linux CLI 手动安装)
我在寻找什么
我创建了一个 .Net 核心测试应用程序并尝试使用以下命令运行该应用程序,一切正常。应用程序运行良好,“Hello World!”,一切顺利。
dotnet new console
dotnet run
但是当我尝试发布和运行应用程序时,
dotnet publish -c Release
dotnet -d contest.dll
它给出了以下错误,我已经确定路径和文件名都是正确的。
Telemetry is: Disabled
projectfactory: MSBUILD_EXE_PATH = /usr/lib64/dotnet/sdk/3.1.111/MSBuild.dll
projectfactory: MSBuild project path =
projecttoolscommandresolver: ProjectFactory did not find Project.
Microsoft.DotNet.Cli.Utils.CommandUnknownException: Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-contest.dll does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
at Microsoft.DotNet.CommandFactory.CommandFactoryUsingResolver.Create(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
我尝试过 API、Console 和其他模板。错误对所有人都一样。
任何帮助将不胜感激。
非常感谢和问候
【问题讨论】:
标签: linux api .net-core console publish