Alan Fisher
Alan Fisher

Reputation: 2055

How do I rename entity framework .edmx file

I have a new MVC 4 project developed by a third party. I want to rename the .edmx file before making some other changes and going to production. I can rename the file itself but the .tt files do not change.

Upvotes: 7

Views: 4898

Answers (1)

Arpit Khandelwal
Arpit Khandelwal

Reputation: 1803

I need to rename my edmx, the designer, diagram and both T4 template files. This is what I did -

  1. Unload the project in VS, edit, rename all above files to whatever you have to. The first part of the name of all these files should be same.
  2. Open project directory in Windows explorer and manually rename all above files. Names should exactly match with what you entered in project file in step 1.
  3. Open both tt files, find and replace the original edmx file name there.
  4. Open EDMX file in a text editor, find and replace with
  5. Reload the project, right click both the tt files one at a time and Run Custom tool. This will regenerate any missing files.

Upvotes: 5

Related Questions