Why I don't need links for non visual studio c # application

When developing C # applications in Visual Studio, I need to add a link to the library that I want to use before I can import it into the application with the using keyword.

If I do not use Visual Studio, I can import the libraries without first adding a link to them. In fact, my question has two points:

  • Why can't C # import libraries manually in Visual Studio (obviously, it works like that)?

  • What adds a link for the project ?, maybe he can find the library or can't?

+4
source share
1 answer

If you look in the same directory as csc.exe , you will find a file called csc.rsp . It lists all the links that are automatically added automatically. The C # compiler still needs to know what to look for - but it has a large, large list by default.

If you use the /noconfig flag, you will see the same behavior as in Visual Studio - each link must be explicitly specified.

As for adding a link to the project: it tells the C # compiler to use this library. All this. Note that using directives are for namespaces, not nodes. They are often called the same, but they are completely different concepts. The using directive does not "import" the library - it simply instructs the C # compiler to look for elements in this namespace when resolving names.

+6
source

All Articles