64

For instance, log4net.dll comes with log4net.xml. What's the use of this xml?

Lieven Cardoen
  • 25,140
  • 52
  • 153
  • 244
  • 3
    possible duplicate of [What is the "log4net.xml" file that gets added to your bin folder](http://stackoverflow.com/questions/2184102/what-is-the-log4net-xml-file-that-gets-added-to-your-bin-folder) – Ani Oct 25 '10 at 13:33

2 Answers2

32

They contain the comments for the code in xml format. They can be used with sandcastle to generate windows help files or MSDN-style html documents.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
  • 9
    and Visual Studio needs them in order to display intellisense for the assembly. –  Oct 25 '10 at 13:38
  • @Will how would that work? I'm using a dll (sharpPDF) with Visual Web Developer 2010 Express and both files are included in the project (even though I never made any reference to the XML file). How would I get Intellisense to work properly? – Jules Jun 23 '11 at 10:04
  • 2
    @Jules: as long as they travel with each other, have the same name (xyz.dll, xyz.xml) it should be picked up. Check your reference, you might be pointing at a dll somewhere else. –  Jun 23 '11 at 12:56
  • 13
    it's possible to delete xml file in release generation? – Luigi Saggese Jun 14 '12 at 11:55
  • 7
    I believe it is safe to remove the XML files from release. You can prevent them being copied in the first place as well. See: http://stackoverflow.com/questions/2011434/preventing-referenced-assembly-pdb-and-xml-files-copied-to-output – PeteWiFi Jul 18 '14 at 15:15
29

This file contains description of the classes, methods, etc created as xml comments in the assembly.

The Microsoft Docs says:

The compiler generated XML file can be distributed alongside your .NET assembly so that Visual Studio and other IDEs can use IntelliSense to show quick information about types or members. Additionally, the XML file can be run through tools like DocFX and Sandcastle to generate API reference websites.

AksharRoop
  • 2,263
  • 1
  • 19
  • 29
Andrew Bezzub
  • 15,744
  • 7
  • 51
  • 73
  • 13
    But what is the 'purpose' of them? – Sprintstar May 01 '15 at 11:28
  • 11
    I think the OP wants to know when it's ok to delete and when not to. Ex. You need the PDB file to be able to debug. In another answer Will says Visual Studio relies on the xml files to display intellisense, I don't think that is true. Is there a reason to keep them around other than to use them as a manifest? – SynBiotik Mar 31 '16 at 18:44
  • 1
    my question is same, is it okie to delete the xml? – RobinAtTech Nov 21 '18 at 22:21