【发布时间】:2021-05-31 22:24:05
【问题描述】:
使用 mono,您可以通过 csc test.cs && mono test.exe 编译和运行 C# 代码。你会如何使用official .NET SDK on Ubuntu?
【问题讨论】:
-
您浏览过您链接到的文档吗?有一个“Hello World”示例说明了这一点:docs.microsoft.com/en-us/dotnet/core/get-started 和 docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli
-
@GuruStron - 当我尝试
dotnet build test.cs时,我得到/home/neubert/test.cs(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.。我猜想使用 dotnet per stackoverflow.com/a/47697996/569976 编译单个 *.cs 文件是不可能的... -
也许this 可以帮忙?
-
@GuruStron - 是的 - 那在我发布的链接中。但是建议的补救措施大约是 300 字节长,而
csc test.cs并不接近。我可以记住csc filename.ext- 我不会记住另一个。我想我可以给它起别名,但我觉得这感觉太费劲了,哈哈