ASP.NET MVC5 - Keeping Users in Oracle Database

前端 未结 4 911
陌清茗
陌清茗 2021-02-02 01:51

Once creating a ASP.NET MVC5 project (with target framework is .NET 4.5.1 and the authentication type is Individual User Account

4条回答
  •  春和景丽
    2021-02-02 02:33

    Andres Bejarano worked great for me but I want to add something that would have savde me a lot of time. First make sure you can connect to your database using Oracle.ManagedDataAccess.Client (I had problems with my TNS names file see OracleConnection.Open is throwing ORA-12541 TNS no listener).

    Second, I was getting the following error when I tried to register a user:

    No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

    This was because I didn't have all the correct Nuget packages installed and/or I had messed up the web.config.

    Make sure you have ODAC installed http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html

    If you uninstall/reinstall the following Nuget packages in order. You should get around this error:

    1. UnInstall-Package Oracle.ManagedDataAccess.EntityFramework
    2. UnInstall-Package Oracle.ManagedDataAccess
    3. UnInstall-Package EntityFramework -Version 6.1.1
    4. Install-Package EntityFramework -Version 6.1.1
    5. Install-Package Oracle.ManagedDataAccess
    6. Install-Package Oracle.ManagedDataAccess.EntityFramework

提交回复
热议问题