Like the question says: In Visual Studio, when in the Model.edmx, when I Update Model from Database... after adding a few new database fields, it's creating an almost duplicate Model1.Designer.cs file that is causing conflicts with the original Model.Designer.cs.
I can delete the new Model1.Designer.cs file, but then the newly added fields aren't available.
Is there a solution to this (other than deleting and recreating the model)?
I had the same problem, the model was generating a second designer.cs file. This was after working through a whole bunch of issues with my installation of vs2010 related to the designer (somehow vs2010 lost the references to a bunch of DLL's related to the Data Entity Model designer requiring rededits and reinstalls).
Taking Kevin's advice, I edited the project file manually to point to my preferred file and it worked. The designer stopped recreating the second file.
Had the same issue, and none of the older answers worked for me. The extra designer kept re-appearing.
My Cause (in the .csproj):
Solution:
The extra SubType caused MSDataSetGenerator to run twice each time. After removing the subtype, you will still need to delete any other erroneously generated MyDataSet1.Designer.cs entries. See Kevin's post for a couple of examples.
If you are using any version control utils like SVN, the easiest way to fix it is to compare working copy with previous revisions and revert one line in .csproj where designer name changed to that with '1' suffix.
Cause:
I can recreate this (and do by mistake now and then): it occurs trying to save the database diagram (edmx file) while running a project such that Visual Studio cannot write to the various files and generates ones with new names. There may be other ways to recreate it by making the files unavailable for writing. The project will keep working, it just creates a problem for version control and I imagine some deployment models.
Symptoms:
extra enitity files in form of [entityname]1.vb, [entityname]1.cs such as Person1.vb
project file has references to redundant files such as:
Remedy
It sounds like you might have deleted and recreated the model (or something similar) but left the original designer file in the directory. Then when you added a new model it had to use Model1 instead of Model as the designer file name. Have you tried excluding the Model.Designer.cs file and leaving it working with the Model1.Designer.cs file instead?
Okay, looking at the project file for a project of ours with a model in, I can see the following potentially relevant sections:
I believe this one tells the project that the code file is part of the project, and should be a subnode of the file model.edmx, and be regenerated when it changes.
We also have this section:
Not sure which of these controls the generated file name, but you could try hand editing your project file to see if it makes a difference. I'd say you'd need to change both at the same time, rather than just one.
This has been reported to Microsoft, but they haven't been able to reproduce it.
See https://connect.microsoft.com/VisualStudio/feedback/details/532800/msdatasetgenerator-create-another-designer1-cs-file-for-my-typed-dataset