4

Since I want to use Postgresql and NHibernate in my ASP.NET MVC4 project, I am wondering if it is possible to use the WebMatrix.WebData.WebSecurity for security and authentication features? NHibernate and Postgres are working already together, but when I want to set up the WebSecurity class with:

WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "Id", "UserName", autoCreateTables: true);

I get the following error message:

Unable to find the requested .Net Framework Data Provider. It may not be installed.

Creating a DbProviderFactory doesn't also work:

<system.data>
  <DbProviderFactories>
    <add name="Npgsql - .Net Data Provider for PostgreSQL" invariant="Npgsql"
      description=".Net Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory" />
  </DbProviderFactories>
</system.data>

Is it in principle possible to use the WebSecurity class without using EntityFramework? Or do you have any suggestion to solve the problem?

ouflak
  • 2,458
  • 10
  • 44
  • 49
core
  • 851
  • 1
  • 8
  • 28
  • I think default connection must be a ms sql server but not sure found a link that might help on this. http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx – Henrik Bøgelund Lavstsen Feb 27 '13 at 21:51

1 Answers1

0

Install this package http://www.nuget.org/packages/Microsoft.AspNet.Providers.Core and try again.

Adhemar
  • 387
  • 5
  • 12