Small DataSet tip - blank/empty .cs files

If you happen to press F7 in the while working in the DataSet designer, it will generate you a class file for your DataSet. If you've pressed F7 accidentally and dont want/need this file, then you might delete it at some point, or someone tidying up your code might decide to do it for you. The file might seem like an obvious candidate for deletion - the main hint being that it contains no code! However, if the file is simply deleted then your solution may no longer compile.

The solution is pretty simple - you simply need to load your XSD in the DataSet designer, and save it. Simple. All the references to the (empty) class will be removed, and once again everything will compile.

It's a pretty obvious fix really, but it can look a bit serious when you delete a blank file and end up with a large amount of compilation errors and you're in a hurry!

Tags: ,

Posted on Monday, January 15, 2007 10:17 PM | ASP.NET Web Development

Like this? Share it!

No comments posted yet.

Post a comment
Please add 1 and 1 and type the answer here:
Remember me?
Ensure the word in this box says 'orange':