Karl Gjertsen

Architect, Developer, Speaker, Bad Golfer,
Raygun brand ambassador and creator of Infiniforms

Entity Framework Error 0019

Having deployed a new website to Microsoft Azure, I got an error:

Schema specified is not valid. Errors:

SqlDatabase.csdl(3,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name ‘xxxxxxxxxxx’ is already defined.

After some digging around, I found the error is a result of having multiple edmx files using the same container name. This seems reasonable enough, but I didn’t have duplicate container names. Yes, I had 2 edmx files, but with separate container names.

Eventually, I connected to the website with an FTP client and discovered that this problem was caused by old DLL’s still being in the server’s bin folder. Since the first deployment, I had used RedGate’s SmartAssembly to obfuscate and merge three DLL’s into one. The TFS build server was then deploying the new combined DLL to the website, but two of the old, and now merged DLL’s were still in the website’s bin folder.

I deleted the old files and everything was working.

Post navigation

%d bloggers like this: