After installing VS 2008 SP1, the LINQ to SQL Designer is not generating code. I get an error message:
Could not load type ' r' from assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
This often happens if you have a partial class for the data-context (etc), and have a using statement before the namespace. Freaky, I know.
so if you have (in your partial class):
using Foo;
namespace Bar {
//...
}
Try rearranging:
namespace Bar {
using Foo;
//...
}
I have no idea why, but this often fixes it. Note you might need to restart VS as well to get it working again, and maybe even go into the dbml designer.