views:

505

answers:

2

I ran into a particularly annoying issue. I have a LinqToSql project up and running..

A X.dbml file has three dependent files an X.cs, X.dbml.layout and X.designer.cs
Now when I drop an additional table into the designer surface and rename the table, I get an property value is invalid 'unspecified error'.
Weird. But then somehow your X.designer.cs file disappears from your project. And now your build is broken. (If you're not using source control, god help you!)

I'm unable to make edits to my dbml file...

A: 

(Posting as a KB) Seems like .net 3.5 SP1 has broken this.

The workaround that worked for me...

  • Rename the X.dbml to Y.dbml in the Solution Explorer. This should bring back your designer.cs file. Again rename it back to X.dbml

This is absolutely nuts. You have to do this after every edit to the dbml. I'm ruing installing 3.5SP1 now

Gishu
+5  A: 

Also, this has been raised as a Connect Bug, that they've marked as "Fixed in a later release", when ever that comes out.

There are also a couple of other workarounds:

If you have a partial class, make sure that any using statements are with the namespaces:

namespace cScape.PM.DataStore.DataContexts
{
  using System.Collections.Generic;
  using System.Linq;

  partial class ConfigDataContext
  {
    [...]
  }
}

And then right-click on the DBML file, and select "Run Custom Tool". This will re-generate your designer file, and you can then build your project - this worked better for me, especially as we're using TFS and that would cause rather odd check-ins.

The connect bug is linked to in the middle of that fourm discussion.

Zhaph - Ben Duguid
How the heck did you figure that out... save me some time today... +1
J.13.L
Google ;) Led me to this question, and the OP's answer, and reading the forum post in there that pointed to the connect bug.
Zhaph - Ben Duguid
This is weird. I search for something and hit a question that I myself had posted on SO :)
Gishu