I had been struggling today with the linq2sql dbml design files. When I start out and place my tables on the designer everything is OK. Them I modify the namespaces and turn off the connection string properties for the data context. Then I want to create partial extensions of my linq entities. So I hit F7 on the files designer. At this point everything is cool too. Then when I change something with the DB’s schema I go back and add another table or delete and re-add an old one, the MyContext.dbml loses the MyContext.design file underneath it. The other 2 (the .cs and the .layout are still there). Naturally it breaks everything I need to start from scratch. Very annoying. Any ideas?
Share
Ah! Yes! You’re using VS2008, right?
This is a known bug, and it actually matters where your
usingdirectives are in your half of thepartialclass…is bad, and trashes the designer file…
is fine!
This only applies when you have
SomeName.dbmlandSomeName.cs, so another fix is to rename the file. This is fixed in VS2010. Crazy, huh?