No need to reference the windows.forms assembly?

The book talks about a small Windows.Forms program

The Windows Forms classes are located in the System.Windows.Forms assembly, which is the System.Windows.Forms.dll file. To compile this program, you will need a link to this assembly. When compiling on the command line, use the / r switch to specify other assemblies.

But I can compile this program from the command line (csc.exe) just fine, without having to reference any assembly. Why is this?

+4
source share
2 answers

csc by default adds links to a bunch of assemblies. Look at csc.rsp in the same directory as csc.exe (for example, c: \ Windows \ Microsoft.NET \ Framework \ v3.5) to find out what is referenced by default.

You can specify your own answer file using @ as follows:

csc @ answers.txt Foo.cs Bar.cs

(This is not very useful, admittedly ...)

You can also prevent the use of the default answer file with /noconfig .

+5
source

Perhaps because it is located in the configuration file as the default directory for include / links.

0
source

Source: https://habr.com/ru/post/1302740/


All Articles