My original dbml file had objects which had data connection to other server/db. As my db is changed to different server and i want to update my spproc when i delete the spproc and drag the new one dbml.designer.cs is deleted. I am using VS 2008 SP1. I can't regenerate all my dbmls as they have lots of tables, sps etc.. Inserting the using inside the dbml namespace doesn't resolve my issue.
Sql – Designer.cs is deleted on adding object in DBML
linq-to-sqlvisual studiovisual-studio-2008
Related Topic
- Visual-studio – The project file has been moved renamed or is not on your computer
- Stop LINQ to SQL dbml from updating connection string when I drag tables into the dbml file
- C# – Drag and Drop From Server Explorer to DataSet and DBML Designer NOT Working
- C# – Adding stored procedure to DBML doesn’t generate *.designer.cs code
Best Answer
I just ran into this same problem. Bizarrely, the solution is to move any using statements into the namespace brackets.
For example, I had this (with the using statement at the top like you would normally see):
And I had to change it to this (With the using statement inside the namespace):
Once I made this change, my designer file was no longer deleted.