接続文字列が正しくなく、「metadata」キーワードがサポートされていないことを示しています。
接続文字列:モデルを生成すると自動的に作成されます
<connectionStrings>
<add name="DataContext" connectionString="metadata=res://*/Models.Model.csdl|res://*/Models.Model.ssdl|res://*/Models.Model.msl;
provider=System.Data.SqlClient;
provider connection string='data source=.\SQLEXPRESS;
initial catalog="Phase 2";
integrated security=True;
multipleactiveresultsets=True;
application name=EntityFramework'"
providerName="System.Data.EntityClient" />
</connectionStrings>
ロールマネージャー:connectionStringNameを上記の接続文字列の名前に設定します
<roleManager enabled="true">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="DataContext" applicationName="/" />
</providers>
</roleManager>
Roles.CreateRoleメソッドを呼び出すと、次のエラーが発生します
An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
内部例外
{"Keyword not supported: 'metadata'."}
何か案は?