I'm developing Asp.NET MVC 4 web application. I'm trying to connect to my database "Test" through Entity Framework Client. I've added EntityFramework reference to project and I'm using MSSQL. From unknown reason, I'm getting the following error: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Did anyone have similar problem?
Settings in web.config are:
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="TestEntities" connectionString="metadata=res://*/TestEDM.csdl|res://*/TestEDM.ssdl|res://*/TestEDM.msl;provider=System.Data.SqlClient;provider connection string="Data Source=MARINA-PC\MSSQL2008R2;Initial Catalog=Test;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
Error occurs at this line in InitializeSimpleMembershipAttribute class:
WebSecurity.InitializeDatabaseConnection("TestEntities", "UserProfile", "UserId", "UserName", autoCreateTables: true);
This is a stacktrace:
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString)
at WebMatrix.Data.Database.<>c__DisplayClass15.<OpenConnectionStringInternal>b__14()
at WebMatrix.Data.Database.get_Connection()
at WebMatrix.Data.Database.EnsureConnectionOpen()
at WebMatrix.Data.Database.<QueryInternal>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args)
at WebMatrix.WebData.DatabaseWrapper.QuerySingle(String commandText, Object[] parameters)
at WebMatrix.WebData.SimpleMembershipProvider.CheckTableExists(IDatabase db, String tableName)
at WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded()
at WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider simpleMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables)
at WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables)
at WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables)