The custom tool ‘MSLinqToSQLGenerator’ failed. Unspecified error
There is an issue in Microsoft’s latest SP1 for Visual Studio 2008. If you have a partial class with Using statement at the top of the file for a Linq-To-SQL Data Classes context object. You will get above error. Visual Studio will delete the corresponding “.designer.cs” file for your data context and nothing will be compiled.
To solve this issue, you may have to move “Using” statements inside namespace declaration. This is a workaround provided by Microsoft.
Comments (15)
Thanks for this information…. I came to work today adding few things to some classes and it started to crash.
I have so many problems with VS SP1 … it screwed more things than fixed. I don’t undertand why they released it at all…
Thanks a lot. It really helped me.
Lifesaver! I was going nuts with this!
Great Post it’s really useful for me Thanks for provide Information.
Sweet! Thanks Dude.
The below suggestion worked for me …
please try running “devenv /resetskippkgs” from the VS2008 command prompt (All Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 Command Prompt).
After a long time searching a solution… there comes one that works
Good Post
I just got this error for the 1st time today– The custom tool ‘MSLinqToSQLGenerator’ failed. Unspecified error — My machine and software is fully patched. This issue seemed to only occur on the file that created “under” the “DataClasses.dbml” file in the Project Explorer, the file that is generated by the Designer when one points to the Context Design Surface and one right-clicks and chooses “View Code”, then THAT partial class physical file must not have ANYTHING at all before its “namespace” line, not even blank lines. However, I did discover that if I make an other physical file somewhere else (not “under” the “DataClasses.dbml” file), and that other file IS an partial class for the same Context then that other file CAN have stuff before the “namespace” line, such as “using” statements. As such, this is, IMHO, my guess is that this is probably an issue with the Run Custom Tool code generation engine, probably T4-related. HTH. Thank you. — Mark Kamoski
Thanks Jay Baddam, that work!
Thank you!
Worked like a charm!
Thanks a lot. It was very helpful
MS needs a spanking.
Thanks for the solution.
Got to the point of identifying that the generated cs was getting deleted but not recreated. Couldnot figure out why.
Thanks again.
Thanks, it helped a lot.
Thank you wery much, for help.
it’s very useful post it’s really helps me a lot
thank u