如何将C#代码转换为目标代码?

时间:2022-09-02 09:28:47

Hai guys, Can any help me how to convert c# code to compiler code or object code

Hai们,可以帮助我如何将c#代码转换为编译器代码或目标代码

5 个解决方案

#1


If you mean MSIL (.NET bytecode) the easiest way to convert C# into that is to... compile it? Pressing build in Visual Studio ought to work. It might be better if the question was a little clearer.

如果你的意思是MSIL(.NET字节码)将C#转换成最简单的方法就是...编译它?在Visual Studio中按下构建应该可以工作。如果问题更清楚一点可能会更好。

#2


It's not entirely clear what you are asking, but I think you are asking how to compile C# code.

你问的问题并不完全清楚,但我认为你在问如何编译C#代码。

The compiler for C# is csc.exe. There are a lot of command line options, but here is an example command line for a very simple DLL:

C#的编译器是csc.exe。有很多命令行选项,但这里是一个非常简单的DLL的示例命令行:

csc /t:library /out:MyCodeLibrary.dll myCode.cs

#3


If you're referring to converting C# code to MSIL (Intermediate Language), you should use csc.exe (or download Visual Studio Express 2008).

如果您指的是将C#代码转换为MSIL(中间语言),则应使用csc.exe(或下载Visual Studio Express 2008)。

#4


If you are looking for a tool that lets you edit, compile and run C# code then Visual Studio Express is the free version of the standard IDE.

如果您正在寻找一种可以编辑,编译和运行C#代码的工具,那么Visual Studio Express是标准IDE的免费版本。

#5


If you want to turn your C# into "real object code", rather than MSIL, then you need to compile as mentioned in other responses then use the Native Image Generator to convert the MSIL to object code.

如果要将C#转换为“真实对象代码”而不是MSIL,则需要按照其他响应中的说明进行编译,然后使用本机映像生成器将MSIL转换为目标代码。

#1


If you mean MSIL (.NET bytecode) the easiest way to convert C# into that is to... compile it? Pressing build in Visual Studio ought to work. It might be better if the question was a little clearer.

如果你的意思是MSIL(.NET字节码)将C#转换成最简单的方法就是...编译它?在Visual Studio中按下构建应该可以工作。如果问题更清楚一点可能会更好。

#2


It's not entirely clear what you are asking, but I think you are asking how to compile C# code.

你问的问题并不完全清楚,但我认为你在问如何编译C#代码。

The compiler for C# is csc.exe. There are a lot of command line options, but here is an example command line for a very simple DLL:

C#的编译器是csc.exe。有很多命令行选项,但这里是一个非常简单的DLL的示例命令行:

csc /t:library /out:MyCodeLibrary.dll myCode.cs

#3


If you're referring to converting C# code to MSIL (Intermediate Language), you should use csc.exe (or download Visual Studio Express 2008).

如果您指的是将C#代码转换为MSIL(中间语言),则应使用csc.exe(或下载Visual Studio Express 2008)。

#4


If you are looking for a tool that lets you edit, compile and run C# code then Visual Studio Express is the free version of the standard IDE.

如果您正在寻找一种可以编辑,编译和运行C#代码的工具,那么Visual Studio Express是标准IDE的免费版本。

#5


If you want to turn your C# into "real object code", rather than MSIL, then you need to compile as mentioned in other responses then use the Native Image Generator to convert the MSIL to object code.

如果要将C#转换为“真实对象代码”而不是MSIL,则需要按照其他响应中的说明进行编译,然后使用本机映像生成器将MSIL转换为目标代码。