I created a new web application project and added the framework. I then created a database/model etc. The framework is split over 2 projects 1 DAL, 1 Entities. On my local machine I'm restricted to SQL Express 2008.
Here is the configuration section from web config:
Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT:
0x80131040)
The config section refers to 4.3.1 but the error 4.1.0. Anyone know what I'm missing here?
sephiroth100
Participant
1118 Points
1001 Posts
Problem with EF4.3 when rolled out to live
Jan 29, 2013 05:31 PM|LINK
I have EF4.3.1 installed on my local machine.
I created a new web application project and added the framework. I then created a database/model etc. The framework is split over 2 projects 1 DAL, 1 Entities. On my local machine I'm restricted to SQL Express 2008.
Here is the configuration section from web config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
Here is the connection string I use:
<add name="PayDayLoanEntities" connectionString="metadata=res://*/Models.PayDayLoans.csdl|res://*/Models.PayDayLoans.ssdl|res://*/Models.PayDayLoans.msl;provider=System.Data.SqlClient;provider connection string='data source=.\SQLEXPRESS;attachdbfilename="C:\Documents and Settings\John\My Documents\Visual Studio 2010\Projects\IL\WebSite\App_Data\PayDayLoans.mdf";integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
All this works!
On my production machine I use SQL 2008 web edition so, changed the connection string as follows:
<add name="PayDayLoanEntities" connectionString="metadata=res://*/Models.PayDayLoans.csdl|res://*/Models.PayDayLoans.ssdl|res://*/Models.PayDayLoans.msl;provider=System.Data.SqlClient;provider connection string='Data Source=localhost;Initial Catalog=PayDayLoans;uid=***;pwd=********";integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
However, I get the following error message:
Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The config section refers to 4.3.1 but the error 4.1.0. Anyone know what I'm missing here?
Any help appreciated.
thaicarrot
Contributor
5132 Points
1465 Posts
Re: Problem with EF4.3 when rolled out to live
Jan 29, 2013 09:29 PM|LINK
You should copy the connectionstring to the web project so that it can find at run time.
Weera
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Problem with EF4.3 when rolled out to live
Jan 31, 2013 12:32 AM|LINK
Hi,
If you are using EF (Code-first). You can try this:
1) Please open "View"=>"SQL Server Explorer" to try to create a connection to the database's table.
2) Then copy the connection string from the property panel.
3) Paste it into web.config