I ran into this problem. Oddly enough, the solution is to move any using statements into namespace brackets.
For example, I had this (using the using statement on top, as you usually saw):
using System.Configuration;
namespace BuildDashboard.Data
{
partial class DashboardDBDataContext
{
...
}
}
And I had to change it to this (using the using statement inside the namespace):
namespace BuildDashboard.Data
{
using System.Configuration;
partial class DashboardDBDataContext
{
...
}
}
As soon as I made this change, my designer file was no longer deleted.
source
share