locked
XML files and assemblies in bin directory RRS feed

  • Question

  • User-1842880510 posted

    This post was placed in the Visual Studio General Questions forum but was move to off-topic because the moderators there don't want to answer the hard questions.  It has to do with the behavior of Visual Studio 2012 when it creates an Asp.Net project

    • In VS 2010 the bin directory was very simple and straight forward.
    • Now in VS 2012 Web apps the bin directory is filled with a bunch of System and Microsoft assemblies a bunch of folders named with the two letter country code use in URLs and a bunch of xml files with the name of the System and Microsoft assemblies. 
    • I can guess the reason for the assemblies is so that the web app can be deployed to servers without the .Net Framework installed or to which the installed app does not have access to the GAC.
    • But what is the reason for all of the xml files. Then to add insult to injury, even though the project is created with all of these xml files listed in the bin folder, each and everyone has a yellow triangle with an exclamation mark beside which I assume means that the file does not exist physically in the folder. When you go to windows explorer sure enough they aren't there.

    What is the purpose of all of these xml files, and if they are needed then why aren't they physically added to the bin folder? I can not publish my project because the files do not exist. Can I delete these files with impunity?

    Additionally when the output window opens in the IDE it opens at the top where the code windows are located. When a code file is double clicked in the Solution Explorer it opens at the bottom where the output window is supposed to be located.  This is very annoying requiring me to stop what I am try to do to properly position those windows manually.

    Thursday, March 6, 2014 10:06 AM

Answers

  • User-1454326058 posted

    Hi joeller,

    For your first question about the xml file of assembly.

    These xml files is the document that used to reflect the description of the classes, properties and so on. For ourselves’ library, we can generate the xml file too.

    Let’s do the test.

    1. Add a new library project and a Console Application (E.g. ClassLibrary1)
    2. Add a class with some properties and summary of them.
      namespace ClassLibrary1
      {
          /// <summary>
          /// Test description
          /// </summary>
         public class Test
          {
             /// <summary>
             /// Get set ID
             /// </summary>
             public int ID { get; set; }
          }
      }
    3. Build that library project, we can find it doesn’t generate the xml file.
    4. Add that DLL reference to the Console Application. (Right click the References folder=>Add Reference=>Browser=>locate to the library’s bin folder and select that DLL file. (Don’t add the project reference, you will not find the difference if use the project reference)
    5. Build the Console Application. Create an instance of the Test class. Move the mouse pointer to the Test code. You will find there is not any description of the Test class. Also, in the Console Application bin folder there isn’t the xml file for the ClassLibrary1.
    6. Ok, let’s return to the ClassLibrary1. Right click the ClassLibrary1=>Properties=>Build=>Check XML documentation file checkbox in the output section.
    7. Build ClassLibrary1 project. You will find it generate the xml file for it.
    8. Remove the ClassLibrary1 reference from Console Application and  re-add that DLL (refer to step 4)
    9. Build the Console Application, you will find it generate the xml file for the ClassLirbrary1.
    10. After that, refer to step 5, you will find there is the description for the Test class and ID property.

    For your second issue, as far as I know, the VS will save the current environment setting if we modify it. (E.g. Move the Error window to other place)

    For more information, please refer to:

    http://msdn.microsoft.com/en-us/library/6k364a7k(v=vs.90).aspx

    First, please try to reset the setting and check the result.

    On the other hand, please update or repair your VS and check the result.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 11, 2014 3:53 AM

All replies

  • User-760709272 posted

    Not sure your xml file issue, seems like maybe you've imported from something or moved from something or, I don't know, but when I create a new project I don't get these files.  If your code is working with these files missing then just deleted them from the project\solution.  As you've already seen, the publisher will abort if it is asked to publish a file it can't find.

    As for the window, VS uses a docking framework which lets you drag any window to where you want it to be.  It's a bit fiddly and takes some trial and error but after playing around you'll be able to get it where you want it.

    Thursday, March 6, 2014 10:14 AM
  • User-1842880510 posted

    Thanks for your quick reply.

    However that is the point.  I have to move every window opened manually to the proper location.  Each time it opens a new window it does so where ever the last window was open.  I run the project to step through it and the output runs on the same row as the code window.  If there is a error the error window opens in the same place.  I move it/them to the bottom where it/they belong(s).  Then wen I stop the code and try to open the code window to see the problem, it opens in the same location as the errors, and output windows and I have to move it to the code window area in order to see any of it.  All of this manual moving of stuff adds up to a considerable amount of wasted time.

    Every test app I created using Visual Studio 2012 MVC 4 created all of the foreign folders and dlls  Some of them even created the xml files as well.

    It appears that this kind of Visual Studio behavior is not the focus of this forum.  As I expected.

    Thursday, March 6, 2014 11:36 AM
  • User-1842880510 posted

    Having received or found no answers to all of my posts I just went ahead and deleted all of the xml files.  This broke the application for a time due to DotNetOpenAuth and microsoft.web.webpages.oatuth.  So I had to delete all of these files.  This made more problems which I solved by adding all the deleted files back in.  Upon doing this it turned out that the Microsoft.Web.WebPages.OAuth had some how been re-added to the project.  This resulted in everything working.  So I deleted all of the files again and this time everything worked, including the run and the publish.

    However I still want to know about those xml files where they came from and why they are there.

    Thursday, March 6, 2014 3:29 PM
  • User-1454326058 posted

    Hi joeller,

    For your first question about the xml file of assembly.

    These xml files is the document that used to reflect the description of the classes, properties and so on. For ourselves’ library, we can generate the xml file too.

    Let’s do the test.

    1. Add a new library project and a Console Application (E.g. ClassLibrary1)
    2. Add a class with some properties and summary of them.
      namespace ClassLibrary1
      {
          /// <summary>
          /// Test description
          /// </summary>
         public class Test
          {
             /// <summary>
             /// Get set ID
             /// </summary>
             public int ID { get; set; }
          }
      }
    3. Build that library project, we can find it doesn’t generate the xml file.
    4. Add that DLL reference to the Console Application. (Right click the References folder=>Add Reference=>Browser=>locate to the library’s bin folder and select that DLL file. (Don’t add the project reference, you will not find the difference if use the project reference)
    5. Build the Console Application. Create an instance of the Test class. Move the mouse pointer to the Test code. You will find there is not any description of the Test class. Also, in the Console Application bin folder there isn’t the xml file for the ClassLibrary1.
    6. Ok, let’s return to the ClassLibrary1. Right click the ClassLibrary1=>Properties=>Build=>Check XML documentation file checkbox in the output section.
    7. Build ClassLibrary1 project. You will find it generate the xml file for it.
    8. Remove the ClassLibrary1 reference from Console Application and  re-add that DLL (refer to step 4)
    9. Build the Console Application, you will find it generate the xml file for the ClassLirbrary1.
    10. After that, refer to step 5, you will find there is the description for the Test class and ID property.

    For your second issue, as far as I know, the VS will save the current environment setting if we modify it. (E.g. Move the Error window to other place)

    For more information, please refer to:

    http://msdn.microsoft.com/en-us/library/6k364a7k(v=vs.90).aspx

    First, please try to reset the setting and check the result.

    On the other hand, please update or repair your VS and check the result.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 11, 2014 3:53 AM