我有2个文件 第一个:
public class Hello{
public void hello(){
System.Console.WriteLine("Hello!Hello!");
}
}
第二个:
class App {
public static void Main() {
Hello h = new Hello(); h.hello();
}
}
我需要知道以下各行的含义和做法
1 >sn -k hello.keys
2 >csc /t:library /keyfile:hello.keys hello.cs
3 >csc /t:exe /reference:hello.dll app.cs
4 > app
5 >csc /t:library /keyfile:hello.keys hello.cs
6 >app
7 >sn -k hello.keys
8 >csc /t:library /keyfile:hello.keys hello.cs
9 > app
10 >csc /t:library hello.cs
11 >app
特别是“app”行! 谢谢你的帮助
答案 0 :(得分:3)
csc /t:library File.cs // Compiles File.cs producing File.dll
List of compiler (csc) options
sn -k outfile //Generates a new key pair and writes it to the specified file.
Overview of Strong Name Tool (sn.exe)
“app”是在行
中将其作为可执行文件后的程序名称csc /t:exe /reference:hello.dll app.cs
答案 1 :(得分:3)
这里运行三个命令:
我不确定你从哪里得到这些,但看起来它可能是在不同阶段之间编辑源文件。只需一次性运行这些就没有意义。
无论如何,这就是命令正在做的事情。