How to: Update XSD queries

Working with an .XSD (XML schema file) in Visual Studio may be easy at first but, it might give you a hard time in the long run. The reason for the latter being that it might refuse to update when you change the schema of your database or when you need to change one of the queries on the XSD tables.

I found that working with an XSD file in a Sitefinity installation was the hardest case so far.

In general, when you need to change the XSD and it fails, you remove all the .cs files that come after it, you close the solution, open it up again, open the XSD and right-click on it and press on Save. The .cs files should be recreated and you’d be good to go.

Not in Sitefinity.

For some reason, it will keep creating a –1 version of the .cs file which will render your code unusable (well, you’d have to change the references).

If you want to save yourself the trouble, add the xsd in a new project (or, an old one) that is not using Sitefinity, make your changes there and build. Replace the new XSD file in your Sitefinity solution and it should work as expected.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

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