Retrofitting dotConnect into MVC5.2 for Identity 2 "Can not obtain Oracle client information from registry"

Retrofitting dotConnect into MVC5.2 for Identity 2 "Can not obtain Oracle client information from registry"

Postby apmcmillan3 » Tue 21 Oct 2014 16:04

I just purchased dotConnect for Oracle Pro 8.4.264. Prior to purchasing I tested the demo on my system with a blank test MVC 5.2, Identity 2 VS2013 solution. I followed the blog and got the Identity authentication working perfectly against my Oracle db.

So now I need to retrofit the Identity authentication into my existing MVC 5.2 project. I installed all of the same Nuget Packages, and then started copying stuff over. Now when I try to login I get the following error:

Code: Select all
Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.

Source Error:


Line 78:          // This doesn't count login failures towards account lockout
Line 79:          // To enable password failures to trigger account lockout, change to shouldLockout: true
Line 80:          var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
Line 81:          switch (result)
Line 82:          {


Code: Select all
[InvalidOperationException: Can not obtain Oracle client information from registry. Make sure that Oracle Client Software is installed, or use Direct mode of connecting to server.]
   Devart.Data.Oracle.OracleHomeCollection.a() +3839
   Devart.Data.Oracle.OracleInternalConnection..ctor(b2 connectionOptions, OracleInternalConnection proxyConnection) +1322
   Devart.Data.Oracle.ap.a(m A_0, Object A_1, DbConnectionBase A_2) +234
   Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, m A_1, DbConnectionBase A_2) +493
   Devart.Common.DbConnectionPoolGroup.a(DbConnectionPool A_0, DbConnectionBase A_1) +120
   Devart.Common.DbConnectionPool.a(DbConnectionBase A_0) +97
   Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection) +1760
   Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0) +282
   Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +593
   Devart.Common.DbConnectionBase.Open() +906
   Devart.Data.Oracle.OracleConnection.Open() +1742
   Devart.Common.Web.Identity.DbDataSource.ExecuteReader(String commandText, List`1 parameterValues, CommandBehavior commandBehavior, Dictionary`2 typeMapping) +146
   Devart.Common.Web.Identity.DbDataSource.FetchRow(String commandText, List`1 parameterValues, Dictionary`2 typeMapping) +23
   Devart.Common.Web.Identity.AspNetTable.b(Dictionary`2 A_0) +52
   Devart.Common.Web.Identity.UserTable`2.SelectByUserName(String userName) +83
   Devart.Common.Web.Identity.UserStore`3.FindByNameAsync(String userName) +64
   Microsoft.AspNet.Identity.Owin.<PasswordSignInAsync>d__29.MoveNext() +295
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +49
   Albacore.Web.Controllers.<Login>d__3.MoveNext() in c:\Projects\SSAB_Mobile_Albacore\Albacore.Web\Controllers\AccountController.cs:80
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
   System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +143
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +23
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
   System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288


Again, it works fine in my test project, but doesn't work in this project...so it shouldn't have anything to do with my Oracle installation.

Any ideas what might be causing the problem?

Thanks,
Andrew McMillan

Edit: In trying to figure out what is wrong, I realized that my test project was configured to run in IIS Express, compared to my real site thats obviously running in Local IIS. When I changed my test site to run in Local IIS, it breaks in the same way as my real project...now I am trying to figure out what that means....

Edit: Found the problem...must have "Enable 32-Bit applications" set to True on the AppPool. This of course means that I then have to dumb down my entire app and supporting DLLs to be able to run 32-bit as they were compiling strictly for x64 before.

Are there any plans to release a native x64 version of the DLL in the future? How many x86 systems are left out there running...
apmcmillan3
 
Posts: 6
Joined: Tue 21 Oct 2014 13:07

Re: Retrofitting dotConnect into MVC5.2 for Identity 2 "Can not obtain Oracle client information from registry"

Postby Pinturiccio » Wed 22 Oct 2014 15:11

The capacity of your application and the capacity of your Oracle Client must be the same. If you want to use 64 bit Oracle Client, your application must be 64 bit too.

According to your description, you have the following situation.
1. Oracle Client with x64 capacity is installed on your computer;
2. The application is built with the 'Platform target' property set to 'Any CPU' or x86;
3. Because of this, you need to set the "Enable 32-Bit Applications" property to true in the IIS Application Pool settings, in order to allow running the x86 application.
4. The application run as x86 looks for Oracle Client x86 and does not find it, because you have only Oracle Client x64. As the result, you get the "Can not obtain Oracle client information from registry" error.

Perform the following actions for solving your issue:
1. Change the 'Platform target' property value to x64 in the properties of your project;
2. Rebuild your application;
3. set the "Enable 32-Bit Applications" property to False in the Application Pool settings.

After this, your application should run.
Pinturiccio
Devart Team
 
Posts: 1866
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle