Strongly-typed DataSets in Subversion

Strongly-typed datasets are the default option for creating a data access layer (DAL) with the various .NET versions of Visual Studio. From the XSD file that defines a strongly-typed dataset, Visual Studio generates a [XSD].Designer.cs and [XSD].xss.  They’re regenerated every time you change the XSD, even if you just change the layout.  This can become a problem when working in teams and it’s necessary to merge changes.  If your Subversion repository is configured to version the generated files, they’ll be marked as conflicting when you update.

These are the steps I’ve taken to merge changes in the situation above:

  1. Delete [XSD].Designer.cs and [XSD].xss.
  2. Resolve conflicts in the XSD file (and mark them as resolved).  This will generate new versions of [XSD].Designer.cs and [XSD].xss.
  3. When resolving conflicts in the files generated in step 2, use the whole file that was just generated.

This will be much easier than trying to resolve conflicts in generated files.

Comments

  1. Joshua says:

    Scott,

    Yeah – we have same setup here at UC and we do the same methods you are doing. However we do notice that if someone pulls down the entire solution from Subversion for the first time they have to double click each XSD and then CTRL+S to save them so that the project doesn’t generate errors.

    Also, there are serveral other files we cannot commit or it causes a heck of a lot of problems such as proj files, etc.

    Now when we go to Commit we have to see a huge list of files we don’t want to commit and it’s getting very hard to understand.

    Do you know of any way to have Subversion filter out certain file extensions? I can’t figure it out…

    Let me know if you can!

  2. Scott says:

    If you use TortoiseSVN, there’s a Global Ignore Pattern option you can fill in with the file pattern (or patterns) you want Subversion to ignore.

    For example, I use ReSharper in my development work. To keep the files ReSharper generates from being versioned, I set my global ignore pattern to the following:
    */_ReSharper* *resharper* _ReSharper*

    So if you wanted to keep out *.Designer.cs files and *.xss files, you’d set the global ignore pattern to:
    *.Designer.cs *.xss

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.