Linq to SQL strange error

Published on : Dec 8, 2009

Category : General

Saravana

Author

Currently I’m using Linq to SQL in one of my internal projects. After adding a stored procedure to the designer, I started to see the following error “The custom tool ‘MSLinqToSQLGenerator’ failed. Unspecified error” and my LinqToSql auto-generated .cs file disappeared from the project. I tried various things like restarting VS (btw its VS 2008 with SP1), closing all the open source files, even going to the extend of deleting the complete .dbml and dbml.layout files etc. I received the same error, when I attempted to run the tool by right-clicking on the .dbml file and selecting “Run Custom Tool”, but this time, it tried to open the source file where I used the DataContext class. This is the solution that worked for me. I Simply excluded that file which used the DataContext class and executed the “Run Custom Tool” again, it worked flawlessly this time, then I included the file back again. HTH Saravana