ローカルマシンにEF4.3.1をインストールしています。
新しいWebアプリケーションプロジェクトを作成し、フレームワークを追加しました。次に、データベース/モデルなどを作成しました。フレームワークは、2つのプロジェクト(1 DAL、1エンティティ)に分割されています。ローカルマシンでは、SQLExpress2008に制限されています。
これがwebconfigの設定セクションです。
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
私が使用する接続文字列は次のとおりです。
<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" />
これはすべてうまくいきます!
私の実稼働マシンではSQL2008Webエディションを使用しているため、接続文字列を次のように変更しました。
<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" />
ただし、次のエラーメッセージが表示されます。
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)
構成セクションは4.3.1を参照していますが、エラー4.1.0です。誰かが私がここで欠けているものを知っていますか?
助けていただければ幸いです。