Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is there any good C# desktop library to implement Card liked UI dashboard? Pin
yccheok12-Jun-20 6:13
yccheok12-Jun-20 6:13 
GeneralRe: Is there any good C# desktop library to implement Card liked UI dashboard? Pin
Richard MacCutchan12-Jun-20 6:43
mveRichard MacCutchan12-Jun-20 6:43 
QuestionHow to handle excel - multiple sheets integration with ODBC Driver connection in C# Pin
Member 1485915110-Jun-20 3:10
Member 1485915110-Jun-20 3:10 
AnswerRe: How to handle excel - multiple sheets integration with ODBC Driver connection in C# Pin
jsc423-Jul-20 6:43
professionaljsc423-Jul-20 6:43 
QuestionSystem.Timers.Timer() called method doesn't run all code Pin
jsmjsm10-Jun-20 1:09
jsmjsm10-Jun-20 1:09 
AnswerRe: System.Timers.Timer() called method doesn't run all code Pin
Richard Deeming10-Jun-20 1:30
mveRichard Deeming10-Jun-20 1:30 
AnswerRe: System.Timers.Timer() called method doesn't run all code Pin
Luc Pattyn10-Jun-20 1:31
sitebuilderLuc Pattyn10-Jun-20 1:31 
QuestionUnable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395810-Jun-20 0:30
Member 1483395810-Jun-20 0:30 
753/5000
Hello,

I wanted to recover data from an oracle 9i database. I work on 64 bit systems.

I downloaded the driver ODAC112040Xcopy_64bit in which I found .dlls (among which there is Oracle.DataAccess.dll) that I added them to a windows console application under visual studio 2012 and I added Oracle. DataAccess.dll as a reference in the application. So it works for recovery.

Now, I wanted to create a web service to do this recovery.

So, I created a project of type "ASP.NET Empty Web Application" for I added an element of type web service just that displays by default "Hello Wrold". When I compile and run the application then I get the following message:



Bonjour,

Je voulais récupérer des données à partir d'une base des données oracle 9i. Je travail sur des systèmes de 64 bit.

J'ai téléchargé le driver ODAC112040Xcopy_64bit dans lequel j'ai trouvé des .dll (parmi lequel il y a Oracle.DataAccess.dll) que j'ai les ajouté à une application windows console sous visual studio 2012 et j'ai ajouté Oracle.DataAccess.dll comme référence dans l'application. Alors ça marche pour la récupération.

Maintenant, je voulais créer un web service pour faire cette récupération.

Alors, j'ai crée un projet de type "ASP.NET Empty Web Application" pour j'ai ajouté un élément de type web service juste que affiche par défaut "Hello Wrold". Lorsque je compile et j’exécute l'application alors j'ai le message suivant :




Server error in application '/'.
Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.
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.BadImageFormatException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.

Source error:

An unhandled exception occurred while running the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.

Assembly load tracking: The following information can help determine why the assembly 'Oracle.DataAccess' could not be loaded.


=== Prior link status information ===
JRN: DisplayName = Oracle.DataAccess
 (Partial)
AVT: partial link information has been provided for an assembly:
AVT: Assembly name: Oracle.DataAccess | Domain ID: 2
AVT: Partial binding occurs when only part of the full assembly name is provided.
AVT: This can cause the workbook to load an incorrect assembly.
AVT: it is recommended to provide a fully specified text identity for the assembly,
AVT: which includes the simple name, version, culture and public key token.
AVT: For more information and solutions to this problem, see the white paper at http://go.microsoft.com/fwlink/?LinkId=109270.
JRN: Appbase = file: /// D: / Development / Projects / WebApplicationWS / WebApplicationWS /
JRN: Initial PrivatePath = D: \ Development \ Projects \ WebApplicationWS \ WebApplicationWS \ bin
Assembly calling: (Unknown).
===
JRN: this link starts in the context of loading default.
JRN: use of the application configuration file: D: \ Development \ Projects \ WebApplicationWS \ WebApplicationWS \ web.config
JRN: use of the host configuration file:
JRN: use of the computer configuration file from C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config.
JRN: strategy not applied to the reference at this stage (private, custom, partial or location-based assembly binding).
JRN: attempt to download the new URL file: /// C: /Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files / vs / b3838e6a / facd81ed / Oracle.DataAccess.DLL.
JRN: attempt to download the new URL file: /// C: /Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files / vs / b3838e6a / facd81ed / Oracle.DataAccess / Oracle.DataAccess.DLL .
JRN: attempt to download the new URL file: /// D: /Developpement/Projets/WebApplicationWS/WebApplicationWS/bin/Oracle.DataAccess.DLL.
ERR: unable to complete the installation of the assembly (hr = 0x8007000b). Detection completed.

Battery trace:


[BadImageFormatException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.]
   System.Reflection.RuntimeAssembly._nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurity0
   System.Reflection.RuntimeAssembly.nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Booleansressressecurity)
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName (AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection + BooleanSuppress15
   System.Reflection.RuntimeAssembly.InternalLoad (String assemblyString, Evidence assemblySecurity, StackCrawlMark & ​​stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
   System.Reflection.RuntimeAssembly.InternalLoad (String assemblyString, Evidence assemblySecurity, StackCrawlMark & ​​stackMark, Boolean forIntrospection) +22
   System.Reflection.Assembly.Load (String assemblyString) +29
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper (String assemblyName, Boolean starDirective) +39

[ConfigurationErrorsException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.]
   System.Web.Configuration.CompilationSection.LoadAssembly


Erreur du serveur dans l'application '/'.
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.
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.BadImageFormatException: 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.

Erreur source:

Une exception non gérée s'est produite lors de l'exécution de la requête Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.

Suivi du chargement de l'assembly: Les informations suivantes peuvent permettre de déterminer la raison pour laquelle l'assembly 'Oracle.DataAccess' n'a pas pu être chargé.


=== Informations d'état de liaison préalable ===
JRN : DisplayName = Oracle.DataAccess
 (Partial)
AVT : des informations de liaison partielle ont été fournies pour un assembly :
AVT : Nom d'assembly : Oracle.DataAccess | ID de domaine : 2
AVT : une liaison partielle se produit lorsqu'une partie seulement du nom complet de l'assembly est fournie.
AVT : cela peut entraîner le chargement d'un assembly erroné par le classeur.
AVT : il est recommandé de fournir une identité textuelle complètement spécifiée pour l'assembly,
AVT : qui comprend le nom simple, la version, la culture et le jeton de clé publique.
AVT : pour plus d'informations et pour obtenir des solutions à ce problème, consultez le livre blanc à l'adresse suivante http://go.microsoft.com/fwlink/?LinkId=109270.
JRN : Appbase = file:///D:/Developpement/Projets/WebApplicationWS/WebApplicationWS/
JRN : PrivatePath initial = D:\Developpement\Projets\WebApplicationWS\WebApplicationWS\bin
Assembly appelant : (Unknown).
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : D:\Developpement\Projets\WebApplicationWS\WebApplicationWS\web.config
JRN : utilisation du fichier de configuration d'hôte : 
JRN : utilisation du fichier de configuration de l'ordinateur à partir de C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
JRN : stratégie non appliquée à la référence à ce stade (liaison d'assembly privée, personnalisée, partielle ou basée sur l'emplacement).
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b3838e6a/facd81ed/Oracle.DataAccess.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b3838e6a/facd81ed/Oracle.DataAccess/Oracle.DataAccess.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///D:/Developpement/Projets/WebApplicationWS/WebApplicationWS/bin/Oracle.DataAccess.DLL.
ERR : impossible de terminer l'installation de l'assembly (hr = 0x8007000b). Détection terminée.

Trace de la pile:


[BadImageFormatException: 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.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
   System.Reflection.Assembly.Load(String assemblyString) +29
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +39

[ConfigurationErrorsException: 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.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +777
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +229
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +140
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +176
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +99
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +310
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +165
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +590

[HttpException (0x80004005): 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.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10082160
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +464

Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.8.4110.0

AnswerRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
OriginalGriff10-Jun-20 0:40
mveOriginalGriff10-Jun-20 0:40 
AnswerRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Dave Kreskowiak10-Jun-20 2:14
mveDave Kreskowiak10-Jun-20 2:14 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395810-Jun-20 5:33
Member 1483395810-Jun-20 5:33 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Dave Kreskowiak10-Jun-20 19:17
mveDave Kreskowiak10-Jun-20 19:17 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395811-Jun-20 3:00
Member 1483395811-Jun-20 3:00 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Dave Kreskowiak11-Jun-20 3:21
mveDave Kreskowiak11-Jun-20 3:21 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395811-Jun-20 3:47
Member 1483395811-Jun-20 3:47 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Dave Kreskowiak11-Jun-20 3:50
mveDave Kreskowiak11-Jun-20 3:50 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395811-Jun-20 6:31
Member 1483395811-Jun-20 6:31 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Dave Kreskowiak11-Jun-20 7:55
mveDave Kreskowiak11-Jun-20 7:55 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Jörgen Andersson11-Jun-20 8:34
professionalJörgen Andersson11-Jun-20 8:34 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395811-Jun-20 21:24
Member 1483395811-Jun-20 21:24 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Jörgen Andersson11-Jun-20 22:31
professionalJörgen Andersson11-Jun-20 22:31 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395812-Jun-20 3:11
Member 1483395812-Jun-20 3:11 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Jörgen Andersson12-Jun-20 3:20
professionalJörgen Andersson12-Jun-20 3:20 
GeneralRe: Unable to load file or assembly 'Oracle.DataAccess' Pin
Member 1483395812-Jun-20 3:12
Member 1483395812-Jun-20 3:12 
QuestionI Want to be able to give more than one output until mobhp = 0? How do i do that? Pin
Ultra9609-Jun-20 3:20
Ultra9609-Jun-20 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.