I have a weird problem that sometimes when I make a change to a Linq object using the O/R designer (usually by adding a field that I’ve added in the DB), when I save the project, the designer.cs file gets deleted!
Fortunately I have my source control to fall back on; I undelete the file and back out the changes to the csproj file. But this is really annoying, and doesn’t appear to have any good reason (the fact that my project contains about 100 objects is not an excuse).
Has anyone else had this trouble? Any idea what could be causing this to happen?
Edit – additional info – my DataContext class is set up with a custom base class. D’ya think this might have something to do with it…?
It may be too early to tell, because the behavior is erratic, but it seems to me that if I keep the designer.cs file open in the IDE editor when I make changes on the .dbml file, then it doesn’t get removed when I hit “Save”.
I’ve tried that a few times, and it seems to work… No good explanation why that should be, but then the problem is not one that can be subjected to logical scrutiny, either…
Later…
Having tried this out a few times, I can say that this consistently works, so I’m marking this as the answer!
Thanks to all for your help!