Installation of .NET dll libraries questions
For downloading and installing .NET/dll, all I need is copying the dll to a specific directory, and let the .NET know about it. Is this correct?
I use mono, so with mono, I set the MONO_PATH to include the directory. And, it looks OK.
Here are my questions.
- With some libraries, not only dll file, but also xml file is provided. For example, I downloaded for System.Data.SQLite, and I have System.Data.SQLite.dll/xml. What's the purpose of this xml file? Do I have to copy this file also?
- For windows system, the .net dll is just like the other dll in terms of calling this dll. Is this correct? I mean, can I just copy the dll in a directory, and making the directory as开发者_如何学Python a part of PATH environment enable the .NET finding the dll.
- The XML is for the IDE intellisense (as others have said). It is not necessary.
- The ability to locate a DLL by setting a path variable, only works for native code on Windows systems. For managed / .net code, the rules of .net fusion are followed. A little over-simplified, the managed DLL must be one of: (a) in the same directory as the executable, (b) strong-named and in a location reachable by an app.config codebase attribute, or (c) in the GAC.
- The XML file is used by your IDE to provide the Intellisense documentation.
- On Windows, copying a .NET assembly to a folder on the path does not seem to allow the executable to find the DLL.
To answer your two questions:
- You do not need the XML file - it is only used for intellisense.
- Yes, the dll location follows the same rules as any other .NET dll. It needs to either be in the application folder (or bin folder for web applications/services) or installed in the GAC.
精彩评论