Can we ignore files from source control ?

Hello All !

I'm now having a solution with several DLLs and a web site for which I generate the xml documentation file.

By default, when I build all the xml fils are built in the bin folder and are added to the source control. Personnaly, I think that these files should not be in the source control and so I was manually doing an "Undo Pending Changes" on each of these files.

Two questions :

  1. Is there a way to say to the source control to ignore all the ".xml" file in the bin fodler
  2. If these files are stored in the source control, for a reason I cannot explain there is then an error : MSB3021 when I try to build on the server. See the error below.  Notice the "\\" in the path. I suppose it cannot access the path because it had retreive the file from the source control and then it tries to replace it with the generated file. 

    Unable to copy file "c:\Builds\DH2\DH2 Debug\Binaries\Mixed Platforms\Debug\DH2.Metier.CRM.xml" to "DH2\\Bin\DH2.Metier.CRM.xml". Access to the path 'DH2\\Bin\DH2.Metier.CRM.xml' is denied.

Can you help me




Answer this question

Can we ignore files from source control ?

  • ericlock

    Ur right. My bin folder is placed under my website.

    But I think there is a a bug to be corrected as having my xml files being generated under the bin folder and source controlled will produce some error during the Build process



  • Mitch Denny

    You have to have the particular item selected in the Solution Explorer window.  For instance, if you have Foo.cs selected, the items in the File -> Source Control menu change, and not only will "Exclude Foo.cs from Source Control" be available as well, but the existing items will change - for instance, the first three would say "Get Latest Version of Foo.cs" and "Get Specific Version of Foo.cs", and "Check Out for Edit Foo.cs" respectively.

  • Felix Jiang

    In Beta3 and Beta3 Refresh there was a regression where the File->Source Control->Exclude <file> from Source Control menu was removed.  This has since been fixed.  To use the Exclude From Source Control functionality in Beta 3 requires one to either use the DTE.SourceControl object's ExcludeItem (or ExcludeItems) call or to manually edit the .vspscc file (not recommended).

    For your specific problem, I'm not sure Exclude From Source Control would help.  The Exclude From Source Control functionality requires a project file and a project hint file so that Visual Studio can track the excluded items.  Web projects do not have project files.  Therefore, Web projects do not provide a way for the user to specify that certain items should be excluded from source control [i.e. even in Visual Studio releases without the menu item regression mentioned above, Exclude <item> From Source Control is unavailable for web project items].  Of course, I'm assuming the 'bin' directory where your xml files are placed is part of your web site.  If it is not, then using the DTE object as mentioned above may be possible.

     

    --Ben Ryan



  • Sanitario

    No solution for now...

    I am suggesting two solutions :

    1. Update the ".proj" file to force the delete of the XML file
    2. Upadte the security of the bin folder so noone can make a check-out or check-in in this folder. You will have sometimes some warning but it works. That's what I'm doing now. Be sure to remove all the files from the bin folder from all the workspaces before doing this.


  • Thomas Andersson

    so what's the solution with web-projects I am having the same problem with xml files in the /bin dir of a web-project

  • WhiteGandalf

    I agree with you, I have "Get Latest Version of Foo.cs" and "Get Specific Version of Foo.cs", and "Check Out for Edit Foo.cs" but no "Exclude from Source Control".

    Is this possible that it is a new option in the very latest version of studio



  • TamNT

    The permissions route would be something you could do once and it would affect all members of the dev team - like Ben said, it also has the benefit of having been tried and known to work.

  • Sinisa

    Euh... ok but no I don't have this option.

    Note that I have VS.NET 2005 Trial Edition for now, using TFS. In File / Source Control here are the options I see:

    • Get Latest Version
    • Get Specific Version
    • Check out for Edit
    • Lock
    • Undo Pending Changes
    • Check In
    • Resume Conflict Resolution
    • Shelve
    • Unshelve
    • View History
    • Compare
    • Open FRom Source Control
    • Add Project from Source Control
    • Migrate Code Analysis Policy Settings to Solution
    • Workspaces
    • Change SOurce Control


  • Jack Burton

    You may want to try excluding the file from source control (File -> Source Control).

    I don't see how I can exclude a file in the SourceControl menu. Can you explain please

    Thanks



  • einhandsegler

    If you can undo the pending adds and prevent the files from being added to SCC, that is our typical recommendation.  See: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=119624&SiteID=1.

    That post also discusses the possibility of cloaking the Bin directory to prevent SCC operations.  The idea of changing SCC permissions on the Bin directory in the repository to prevent access is a similar concept (and has the benefit of being tried by this thread's poster).

    --Ben Ryan



  • MarkR_OmniVue

    1) Select the file you want to exclude from source control in the Solution Explorer window (for instance, we'll call it foo.xml)

    2) Go to the File -> Source Control menu - there should now be an entry that says "Exclude foo.xml from Source Control"

    Note that if you right-click on the file in Solution Explorer you'll see an "Exclude from Project" but that's not the same thing and you should definitely use the "Exclude from Source Control" choice instead.



  • Teo Lachev

    as I posted in the referenced thread, I just hope you guys will have a better solution than this for RTM. I can't keep having TeamBuild fail, just because someone in the dev-team forgot about undoing the ADD or something.

    you can't be serious about the "solutions" provided!



  • ScottEDyer

    hi,

    thanks for the feedback. I was/am hoping, MS is going to present one.



  • Nightmare_BE

    You may want to try excluding the file from source control (File -> Source Control).

    The problem in the second question is that the file is read only.  The process that copies the generated xml back to the bin directory fails to do so because the file there is read-only due to being in source control.  The app that generates the xml apparently is not aware of source control.

    Buck



  • Can we ignore files from source control ?