My .net project (Any CPU) is referring to Oracle.dataaccess x86 version . In my local GAC the odac version is x86. But in the web server where it was installed previously was having AMB64 version of odac in GAC . The site was working without any problem . Now I need to move the site to AWS .The windows instance in AWS has the below configuration.
OS version : Microsoft windows server 2012 R2 Standard .
IIS 8.5
The server is clean and does not have any software installed .
When I try to create a site , I ended up seeing **could not load file or assembly one of its dependencies **. Through forums I installed various libraries from Oracle but I don't understand what are the exact steps needed . I was just doing trial and error.
Please let me know the software or steps to follow which needs do be installed such that my .net site which is connecting to its Oracle database works .
Edit 1 :
Hi ,
I performed the following steps .
- As suggested by you I added Oracle.managedDataaccess dll(x86) . It worked well in my local.
- Deployed the same code in the server.
- I installed the oracle_12.1.0.1.0
- In C:/oracle_12.1.0.1.0/odp.net/managed/x86 I ran the bat file for configuring the managed odac in the server. I was able to see the changes in the machine.config file . 5.Now when I ran the site I got the below error .
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Oracle.DataAccess.Client.OpsInit.CheckVersionCompatibility(String version) at Oracle.DataAccess.Client.OracleInit.Initialize() at Oracle.DataAccess.Client.OracleClientFactory..cctor() --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized) at System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj) at System.Reflection.RtFieldInfo.GetValue(Object obj) at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) at System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName) at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) at System.Data.Entity.Internal.LazyInternalConnection.Initialize() at System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
at Sample.Data.AbstractEFUnitOfWork2.SetClientId(String clientId)
1..ctor(IUow uow, IConnectionManager cm, IEnumerable`1 allowedAppUserbases, String connectionName, Boolean allowSaves)
at Sample.Web.Controllers.ApiControllerBase
In order to fix this I added OraOps12 dll from c:/oracle_12.1.0.1.0/bin to the wwwroot/site/bin folder. Then I got the below error .
System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed. at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) at System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName) at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) at System.Data.Entity.Internal.LazyInternalConnection.Initialize() at System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
at Sample.Data.AbstractEFUnitOfWork2.SetClientId(String clientId)
1..ctor(IUow uow, IConnectionManager cm, IEnumerable`1 allowedAppUserbases, String connectionName, Boolean allowSaves)
at Sample.Web.Controllers.ApiControllerBase
Checking to resolve this . Appreciate your suggestions.