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)

 

  1. Joshua says:

    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…

  2. Salih Unsal says:

    Thanks a lot. It really helped me.

  3. Chris says:

    Lifesaver! I was going nuts with this!

  4. Great Post it’s really useful for me Thanks for provide Information.

  5. JohnOpincar says:

    Sweet! Thanks Dude.

  6. Jay Baddam says:

    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).

  7. Leo says:

    After a long time searching a solution… there comes one that works

    Good Post

  8. Mark Kamoski says:

    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

  9. Gisela says:

    Thanks Jay Baddam, that work!

  10. Tami says:

    Thank you!
    Worked like a charm!

  11. Davor says:

    Thanks a lot. It was very helpful

  12. Kiran says:

    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.

  13. Pauli says:

    Thanks, it helped a lot.

  14. Ender says:

    Thank you wery much, for help.

  15. Mohamed Magdy says:

    it’s very useful post it’s really helps me a lot
    thank u

Leave a Reply