Entity structure error when updating a model from a database and vice versa

This is what happens when I try to update a model from the VS express 2013 database for the Internet, EF6.1.1, and the .NET framework 4.5.

In this case, I just added a field to the table in the table definition and updated the database.

After that, I right-clicked the update model from the database in the EDMX model view and I get this error message:

An exception of type 'System.runtime.interopServices.COMException occurred while trying to update from the database. The exception is the message: "A file or folder with the name" Model.Context.tt "already exists. Specify a unique name for the element that you add or delete an existing element.

I noticed that I am getting the same error message when I try to create a database from a model.

I tried the following methods:

but none of them worked.

I also found that https://entityframework.codeplex.com/workitem/1104 and it seems that it was resolved using "commit 7e8331d1d22d (EFTools repo)".

Can someone help me in solving my problem or what is "commit 7e8331d1d22d (EFTools repo)"?

thanks

Boid

+5
source share
1 answer

This is an old question, but I just ran into the same problem. Finally found a solution in this bug report . Check if you have * .tt files that are not added to the solution and delete them. This posed a problem for me.

+2
source

Source: https://habr.com/ru/post/1211932/


All Articles