sách gpt4 ăn đã đi

c# - 从命令行编译 C# 代码会出错

In lại 作者:IT王子 更新时间:2023-10-29 04:26:29 26 4
mua khóa gpt4 giày nike

我正在学习本教程:

http://www.csharp-station.com/Tutorials/Lesson01.aspx

我将其粘贴到一个文本文件中,将其命名为 Welcome.cs:

// Namespace Declaration
sử dụng Hệ thống;

// Program start class
class WelcomeCSS
{
// Main begins program execution.
static void Main()
{
// Write to console
Console.WriteLine("Welcome to the C# Station Tutorial!");
}
}

然后我进入命令提示符,指向文件的目录。我键入 csc.exe Welcome.cs 并收到此错误消息:

csc.exe is not recognized as internal or external command

我正在使用 Visual Studio 2008

我尝试将 csc.exe 移动到 Windows 目录,但现在出现此错误:

fatal error cs2018: unable to find messages file 'cscompui.dll'

如何从命令行编译我的 C# 代码?

câu trả lời hay nhất

csc.exe 不在您的路径中。尝试完全限定它:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe

(当然,用您正在使用的任何框架替换 3.5。)

请注意,此处未使用 Visual Studio。你使用的是什么版本并不重要,因为当你从命令行编译时你没有使用它。命令行编译器是框架本身的一部分。

关于c# - 从命令行编译 C# 代码会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3425515/

26 4 0
IT王子
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress