c# - 在 ubuntu 19.10 上安装 .NET 核心后无法运行示例控制台应用程序
问题描述
根据以下说明安装 .NET core sdk 后:
https://dotnet.microsoft.com/download/linux-package-manager/ubuntu19-04/sdk-current
我使用
dotnet new console
. 运行dotnet run
给出以下错误:
System.ComponentModel.Win32Exception(2):没有那个文件或目录
在 System.Diagnostics.Process.ForkAndExecProcess(字符串文件名,字符串 [] argv,字符串 [] envp,字符串 cwd,布尔重定向标准输入,布尔重定向标准输出,布尔重定向标准错误,布尔 setCredentials,UInt32 用户 ID,UInt32 组 ID,UInt32 [] 组,Int32 和标准输入, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Microsoft.DotNet.Cli.Utils.Command.Execute() at Microsoft.DotNet.Tools.Run.RunCommand.Execute() 在 Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args) 在 Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)在 Microsoft.DotNet.Cli.Program.Main(String[] args)
我的dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: ubuntu
OS Version: 19.10
OS Platform: Linux
RID: ubuntu.19.10-x64
Base Path: /usr/share/dotnet/sdk/3.0.100/
Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858
.NET Core SDKs installed:
3.0.100 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
请注意,我的版本是 19.10。这真的是原因吗?
*.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
解决方案
推荐阅读
- mysql - 无法创建在两个表中插入数据的过程
- angular - 是否可以在运行时将 observables 添加到 combineLatest (或类似的)?
- remote-access - 如何为 Android 实现远程桌面?
- java - Java DTO 对象搜索机制?
- gitlab - Gitlab在输出中发送当前日期
- java - 使用 SectionStatPageAdapter 和 bundle 将数据从活动发送到多个片段
- excel - VBA 中的 REST GET 调用返回“完成此操作所需的数据尚不可用”
- opencv - 如何将多个项目构建为多个 Webassembly wasm 文件并共享它们?
- .net - Entity Framework Core 在过滤时不包括相关实体
- python - Fold/reduce boolean values in masked loss function Keras