Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

C# Console Application Failing to Load Oracle DataAccess from 64 bit system

3186076Feb 26 2016 — edited Feb 26 2016

Hi, I am building a c# console application in Visual Studio 2010 to access Oracle DB. When I debug my application from VS 2010, it is able to make connection to Oracle and get the results. but when I run the application from my release folder just by clicking on exe, it throws an exception below. Appreciate if someone can help resolve this issue ASAP? Thank you much.

 

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has

 

been thrown by the target of an invocation. ---> System.BadImageFormatException:

 

Could not load file or assembly 'Oracle.DataAccess, Version=2.112.3.0, Culture=

 

neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt

 

was made to load a program with an incorrect format.

 

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String cod

 

eBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&

 

stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntro

 

spection, Boolean suppressSecurityChecks)

 

   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as

 

semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMar

 

k& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIn

 

trospection, Boolean suppressSecurityChecks)

 

   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)

 

   at System.Data.Metadata.Edm.MetadataAssemblyHelper.SafeLoadReferencedAssembly

 

(AssemblyName assemblyName)

 

   at System.Data.Metadata.Edm.MetadataAssemblyHelper.<GetNonSystemReferencedAss

 

emblies>d__0.MoveNext()

 

   at System.Data.Metadata.Edm.DefaultAssemblyResolver.GetAllDiscoverableAssembl

 

ies()

 

   at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResou

 

rces(String assemblyName, String resourceName, ICollection`1 uriRegistry, Metada

 

taArtifactAssemblyResolver resolver)

 

   at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource..ctor(Str

 

ing originalPath, String assemblyName, String resourceName, ICollection`1 uriReg

 

istry, MetadataArtifactAssemblyResolver resolver)

 

   at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateRes

 

ourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, I

 

Collection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)

 

   at System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths)

 

   at System.Data.Common.Utils.Memoizer`2.Result.GetValue()

 

   at System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg)

     at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2016
Added on Feb 26 2016
1 comment
1,339 views