Unable to load file or assembly 'Oracle.DataAccess'
-
Translated:
Quote:
Hello Oracle Data Access driver of 64-bit version When I create a console app it works for the driver. When I create a web application asp.net then the driver does work. The properties of this application: - target framework 4.0 - Platform target: any CPU I changed 'any cpu' to 'X86' but the same problem then with 'X64' also the same problem - the web: I checked the option "use Visual Studio Development Server" instead of "use Local IIS Web Serve"
A console app is not an ASP.NET app. They work in completely different ways. A platform target of "AnyCPU" runs, by default either as the CPU architecture on older versions of .NET or as a 32-bit app. Changing the platform target to "X86" forces the app to run as 32-bit only, even on a 64-bit machine. Change the target to x64 to match the architecture of the .DLL's you're using. In IIS, in the Application Pool you are running your code under, under Advanced Options, there is an option to run the app as a 32-bit app instead of 64-bit. If that setting is turned on, your code will run as 32-bit instead of 64-bit. Also, you MUST install the Oracle Client on the IIS server in order for Oracle database access to work.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakJe vous informe que dans les paramètres avancés de pool application que l'option " activer les applications 32 bits" est déja comme valeur "false" j'ai changé "Platform target" à X86 mais le même message d'erreur.
Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.
-
Je vous informe que dans les paramètres avancés de pool application que l'option " activer les applications 32 bits" est déja comme valeur "false" j'ai changé "Platform target" à X86 mais le même message d'erreur.
Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.
Translated:
Quote:
I inform you that in the advanced application pool settings that the option "activate 32-bit apps" is already as "false" I changed "Platform target" to X86 but the same error message. Can't load the 'Oracle.DataAccess' file or assembly or any of its dependencies. Attempting to load an incorrectly format program.
Uhhh... I just got done telling you that x86 means "32-bit" and running 32-bit code in the App Pool is turned OFF. Change the platform target back to x64. Now, if you're deploying just a single Oracle .DLL with your app, you're definitely doing it wrong. Oracle requires and entire Client installation in order to work. Just deploying one of two .DLL's with Oracle in the name will NOT WORK.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Translated:
Quote:
I inform you that in the advanced application pool settings that the option "activate 32-bit apps" is already as "false" I changed "Platform target" to X86 but the same error message. Can't load the 'Oracle.DataAccess' file or assembly or any of its dependencies. Attempting to load an incorrectly format program.
Uhhh... I just got done telling you that x86 means "32-bit" and running 32-bit code in the App Pool is turned OFF. Change the platform target back to x64. Now, if you're deploying just a single Oracle .DLL with your app, you're definitely doing it wrong. Oracle requires and entire Client installation in order to work. Just deploying one of two .DLL's with Oracle in the name will NOT WORK.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakBonjour, J'ai téléchargé le dossier .zip ODAC112040Xcopy_32bit et ODAC112040Xcopy_64bit Est ce que je dois utiliser ODAC 32bit ou bien ODAC 64bit ? Ce dossier contient plusieurs types de dll alors quel(s) .dll à ajouter dans mon projet ?
-
Bonjour, J'ai téléchargé le dossier .zip ODAC112040Xcopy_32bit et ODAC112040Xcopy_64bit Est ce que je dois utiliser ODAC 32bit ou bien ODAC 64bit ? Ce dossier contient plusieurs types de dll alors quel(s) .dll à ajouter dans mon projet ?
Translated:
Quote:
Hello I downloaded the .zip folder ODAC112040Xcopy_32bit and ODAC112040Xcopy_64bit Do I have to use ODAC 32bit or ODAC 64bit? This folder contains several types of dll so what .dll to add to my project?
You're doing this all wrong. You don't just add a .DLL to your project. Oracle does not work that way. Forget what you downloaded. You have to install the Oracle Client and add ODP.NET to your project through the Nuget Package Manager under the Tools menu in Visual Studio. In NPM, search for "ODP.NET4" and add that to your project. When deploying your application to a server, that server must also have the Oracle Client installed else your application will not work.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Translated:
Quote:
Hello I downloaded the .zip folder ODAC112040Xcopy_32bit and ODAC112040Xcopy_64bit Do I have to use ODAC 32bit or ODAC 64bit? This folder contains several types of dll so what .dll to add to my project?
You're doing this all wrong. You don't just add a .DLL to your project. Oracle does not work that way. Forget what you downloaded. You have to install the Oracle Client and add ODP.NET to your project through the Nuget Package Manager under the Tools menu in Visual Studio. In NPM, search for "ODP.NET4" and add that to your project. When deploying your application to a server, that server must also have the Oracle Client installed else your application will not work.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakActually, the XCopy installation of Oracle client should work if you add all the files to the bin folder. But only if you don't have another installation with another bitness.
Wrong is evil and must be defeated. - Jeff Ello
-
Actually, the XCopy installation of Oracle client should work if you add all the files to the bin folder. But only if you don't have another installation with another bitness.
Wrong is evil and must be defeated. - Jeff Ello
Bonjour, J'ai téléchargé "ODAC112040Xcopy_32bit" et j'ai copié les .dll necessaires dans mon projet et j'ai ajouté le driver "Oracle.DataAccess.dll" dans la partie reference de mon projet. J'ai target platform avec 32 bit. Après compilation et exécution, alors le driver a été bien chargé mais je ne peux pas connecter au base oracle sachant que de version 9i et lire le contenu d'une table. J'ai le message suivant :
System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'Oracle.DataAccess.Client.OracleConnection'. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
à Oracle.DataAccess.Client.OracleInit.Initialize()
à Oracle.DataAccess.Client.OracleConnection..cctor()
--- Fin de la trace de la pile d'exception interne ---
à Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
à WebServiceToBD.Service1.view_data() dans d:\Developpement\SiteVs2012\WebServiceToBD\Service1.asmx.cs:ligne 48Voici le code de méthode :
public DataTable view_data()
{
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
conn.Open();
OracleDataAdapter dr = new OracleDataAdapter("select * from Personne", conn);
DataSet ds = new DataSet();
ds.Tables.Add("Personne");
dr.Fill(ds,"Personne");
DataTable tt = ds.Tables[0];
return tt;
}La ligne 48 correspond au code suivant :
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
Cette chaîne de connexion existe dans le programme et pas dans le fichier "Web.config".
-
Bonjour, J'ai téléchargé "ODAC112040Xcopy_32bit" et j'ai copié les .dll necessaires dans mon projet et j'ai ajouté le driver "Oracle.DataAccess.dll" dans la partie reference de mon projet. J'ai target platform avec 32 bit. Après compilation et exécution, alors le driver a été bien chargé mais je ne peux pas connecter au base oracle sachant que de version 9i et lire le contenu d'une table. J'ai le message suivant :
System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'Oracle.DataAccess.Client.OracleConnection'. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
à Oracle.DataAccess.Client.OracleInit.Initialize()
à Oracle.DataAccess.Client.OracleConnection..cctor()
--- Fin de la trace de la pile d'exception interne ---
à Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
à WebServiceToBD.Service1.view_data() dans d:\Developpement\SiteVs2012\WebServiceToBD\Service1.asmx.cs:ligne 48Voici le code de méthode :
public DataTable view_data()
{
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
conn.Open();
OracleDataAdapter dr = new OracleDataAdapter("select * from Personne", conn);
DataSet ds = new DataSet();
ds.Tables.Add("Personne");
dr.Fill(ds,"Personne");
DataTable tt = ds.Tables[0];
return tt;
}La ligne 48 correspond au code suivant :
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
Cette chaîne de connexion existe dans le programme et pas dans le fichier "Web.config".
When you are using unmanaged code (the Oracle Client in this case), EVERYTHING need to have the same bitness (32 or 64 bits), including the client, debugger, IIS Application pool and the VSHost.exe. More info on that here: Visual Studio Debugging and 64 Bit .NET Applications - Rick Strahl's Web Log[^] In this case I'm not even sure if you have the same bitness on the Oracle.DataAccess.dll and the rest of the client files. You can use corflags.exe to determine bitness of an .exe
Wrong is evil and must be defeated. - Jeff Ello
-
When you are using unmanaged code (the Oracle Client in this case), EVERYTHING need to have the same bitness (32 or 64 bits), including the client, debugger, IIS Application pool and the VSHost.exe. More info on that here: Visual Studio Debugging and 64 Bit .NET Applications - Rick Strahl's Web Log[^] In this case I'm not even sure if you have the same bitness on the Oracle.DataAccess.dll and the rest of the client files. You can use corflags.exe to determine bitness of an .exe
Wrong is evil and must be defeated. - Jeff Ello
Thanks it works for the driver. I used this driver in a .net web service. Then I will call this web service in another asp net project. The web service call and the data recovery work on a table with a reduced number of lines. Now, I wanted to retrieve the contents of a table that contains 1844 rows and 58 columns. After compilation and execution, I have the following message:
Server error in application '/'.
The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information on the error and its origin in the code.Exception details: System.ServiceModel.QuotaExceededException: The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
-
When you are using unmanaged code (the Oracle Client in this case), EVERYTHING need to have the same bitness (32 or 64 bits), including the client, debugger, IIS Application pool and the VSHost.exe. More info on that here: Visual Studio Debugging and 64 Bit .NET Applications - Rick Strahl's Web Log[^] In this case I'm not even sure if you have the same bitness on the Oracle.DataAccess.dll and the rest of the client files. You can use corflags.exe to determine bitness of an .exe
Wrong is evil and must be defeated. - Jeff Ello
Erreur du serveur dans l'application '/'.
Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.Détails de l'exception: System.ServiceModel.QuotaExceededException: Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
-
Thanks it works for the driver. I used this driver in a .net web service. Then I will call this web service in another asp net project. The web service call and the data recovery work on a table with a reduced number of lines. Now, I wanted to retrieve the contents of a table that contains 1844 rows and 58 columns. After compilation and execution, I have the following message:
Server error in application '/'.
The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information on the error and its origin in the code.Exception details: System.ServiceModel.QuotaExceededException: The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
maxReceivedMessageSize defaults to 64kb. You need to add the property to the binding in the configuration file and give it a fitting value. BasicHttpBinding.MaxReceivedMessageSize Property (System.ServiceModel) | Microsoft Docs[^]
Wrong is evil and must be defeated. - Jeff Ello