书上说了一个小的 Windows.Forms 程序
The Windows Forms classes are in the System.Windows.Forms assembly, which is the System.Windows.Forms.dll file. To compile this program you need a reference to that assembly.When compiling on the command line, use the /r switch to specify other assemblies.
但我可以从命令行 (csc.exe) 编译该程序,无需引用任何程序集。这是为什么?
最佳答案
csc
默认添加对一堆程序集的引用。查看与 csc.exe
相同的目录中的 csc.rsp
(例如 c:\Windows\Microsoft.NET\Framework\v3.5)以查看引用的内容默认情况下。
您可以指定自己的 response file用这样的@:
csc @responses.txt Foo.cs Bar.cs
(诚然,这不是经常有用...)
您还可以防止默认响应文件与 /noconfig
switch 一起使用.
关于c# - 不需要引用 windows.forms 程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2356180/