Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

edmx re building creats a duplicate designer cs file

So, with my edmx (MyDatabase.Edmx) file, whenever I update model from database and I rebuild the project, it creates a duplicate designer file (MyDatabase1.Designer.cs). Was wondering if anyone knows of a config file to avoid creating the duplicate file? It happens on my local for dev purposes, my other teammates doesn't get the same issue.

like image 868
gdubs Avatar asked Dec 29 '25 11:12

gdubs


2 Answers

I know this is an old question but I was facing the same problem and found how to resolve it properly. If you look inside the project file containing your .edmx file (so open the .csproj file in any text editor) you'll see many occurrences of the .Designer.cs file name (MyDatabase1.Designer.cs in your case). Change them to MyDatabase.Designer.cs and rename MyDatabase1.Designer.cs file to MyDatabase.Designer.cs to fix the problem.

like image 196
Piotr Avatar answered Jan 01 '26 19:01

Piotr


Looks like you have MyDatabase.Designer.cs included in your project as a regular source file. Just exclude it, delete MyDatabase1.Designer.cs and rebuild the project.

like image 24
Sergey Sirotkin Avatar answered Jan 01 '26 19:01

Sergey Sirotkin