Unable to load 'Devart.Data.Oracle'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
vinz
Posts: 11
Joined: Fri 16 Jan 2015 12:51

Unable to load 'Devart.Data.Oracle'

Post by vinz » Thu 23 Apr 2015 08:47

Hello, i have develop an asp.net mvc app using dotconnect for Oracle and EF 6. It work perfectly on local Visual Studio. But when i try to deploy it on IIS 7.5 i have the error :
"The ADO.NET provider invariant with the name 'Devart.Data.Oracle' is not part of the computer or the application configuration file, or it can not be loaded. See inner exception for details"

The stacktrace :

Code: Select all

à System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.<GetService>b__0(ArgumentException e, String n) à System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup) à System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) à System.Data.Entity.Infrastructure.DependencyResolution.CachingDependencyResolver.GetService(Type type, Object key) à System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() à System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) à System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() à System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) à System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key) à System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService[T](IDbDependencyResolver resolver, Object key) à System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) à System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) à System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) à System.Data.Entity.Internal.LazyInternalConnection.Initialize() à System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() à System.Data.Entity.Internal.LazyInternalContext.InitializeContext() à System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) à System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() à System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() à System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() à System.Linq.Queryable.OrderBy[TSource,TKey](IQueryable`1 source, Expression`1 keySelector) à Ope.Repository.PdsRepository.GetListPdsNames() à GeoscienceOPEApplication.Controllers.ResultatsController.Search() à lambda_method(Closure , ControllerBase , Object[] ) à System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) à System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) à System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) à System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) à System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() à System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() à System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) à System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() à System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)

In the /bin of the application i have put : devart.data.dll devart.data.oracle.dll and devart.data.oracle.entity.dll

In my web.config file i have :

Code: Select all

<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices,Devart.Data.Oracle.Entity, Version=8.4.333.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
I have tried to put in the app.config :

Code: Select all

<system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.4.333.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
Any ideas of what is wrong ?
thanks

vinz
Posts: 11
Joined: Fri 16 Jan 2015 12:51

Re: Unable to load 'Devart.Data.Oracle'

Post by vinz » Thu 23 Apr 2015 14:07

I have copy the <DbProviderFactories> part from app.config to web.config and now i have an other error :
Underlying provider failed on Open

I search on the web and it seems to be a generic error for a problem of connection to database.

In my web config i have this connectionstring :

Code: Select all

<connectionStrings>
<add name="ENVEntitiesConnectionString" connectionString="metadata=res://Ope.DAL/OpeDataModel.csdl|res://Ope.DAL/OpeDataModel.ssdl|res://Ope.DAL/OpeDataModel.msl;provider=Devart.Data.Oracle;provider connection string="User Id=XXX;Password=XXX;Server=dbTnsName;Persist Security Info=True"" providerName="System.Data.EntityClient" />
  </connectionStrings>
In the "server" variable, i have specify the alias name of the database specify in the tnsname.ora.

In Visual Studio it work but not on IIS. (The database is up and the alias name is good).

Did i forget a parameter or something else (permission ?? ...)

Thanks

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Unable to load 'Devart.Data.Oracle'

Post by Shalex » Fri 24 Apr 2015 07:02

vinz wrote:I have copy the <DbProviderFactories> part from app.config to web.config and now i have an other error :
Underlying provider failed on Open
This is an outer error. There should be the inner exception with the root cause. Please specify the full call stack with all inner exceptions.

Post Reply