我下面这个教程:命令行编译的C#代码提供了错误
http://www.csharp-station.com/Tutorials/Lesson01.aspx
我这贴到一个文本文件,将其命名为Welcome.cs:
// Namespace Declaration
using System;
// 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#代码?
仅供参考......你不应该移动CSC .exe到Windows文件夹。它有太多的依赖关系,它将无法找到。 – David 2010-08-06 16:01:14