While the new LINQ features in VS 2008 are great, I’ve had a few problems. Here is #0001. Actually #0001 is probably random crashes, but I can’t really narrow that down to repeatable steps.
After dragging a few tables from my database onto the design surface, all of my LINQ code worked great. Then I added a new table to the designer and I was not able to access it using LINQ. It was on the design surface, but the code for the datacontext class was not being regenerated. I rebuilt, closed VS deleted the compiled DLLs, but no luck. Pretty frustrating. Obviously a big downside of wizard generated code is that when it’s not working, there isn’t much you can do.
The way I ultimately got it fixed was the following.
Renamed my current .dbml file, “LINQTest.dbml” to “LINQTest2.dbml”
Copied “LINQTest2.dbml” into the same location
Renamed “Copy of LINQTest2.dbml” to “LINQTest.dbml”
Designer regenerated code behind file for “LINQTest.dbml.
Not ideal. Clearly you want to make you changes in large batches if possible. I imagine this will be fixed in the final version coming out soon. Still it’s a little surprising that a big feature like this would have an obvious bug in Beta 2.Comments Off , permalink