I’m trying to generate a Controller usind the Scaffolding Template “Controller with read/write actions and views, using Entity Framework”.
I created an ADO.net Data Entity Model and connected it to an MSSQL 2008 DB (hosted by GoDaddy) and I am able to select the correct Model class and Data context class, but when I click “Add”, I get the following error:
Unable to retrieve metadata for ‘Project.Models.ModelClass’. The entry ‘ProjectDataContext’ has already been added. (C:\Users…\Temp\tmpD167.tmp line 13)
The file “tmpD167.tmp” is a copy of my web.config
Line 13 is a connection string that looks like this (post sanitation):
<add name="ProjectDataContext" connectionString="metadata=res://*/Models.Project.csdl|res://*/Models.Project.ssdl|res://*/Models.Project.msl;provider=System.Data.SqlClient;provider connection string="data source=project.db.12345678.hostedresource.com;initial catalog=projectdb;persist security info=True;user id=projectdbuser;password=Password00##;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I have 2 other connection strings (one for ApplicationServices and the other for the project data) that are on lines 11 and 12.
Is my connection string formatted correctly?
can you remove your .edmx file and the reference to it in the web config and thenrecreate it?