Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
680 views
in Technique[技术] by (71.8m points)

visual studio 2010 - Could not load file or assembly "Oracle.DataAccess" or one of its dependencies

I am trying to run this web application. I keep getting this error "Could not load file or assembly "Oracle.DataAccess" or one of its dependencies. An attempt was made to load a program with an incorrect format." Exception details: System.BadImageFormatException. "Could not load file or assembly "Oracle.DataAccess" or one of its dependencies. An attempt was made to load a program with an incorrect format." Below are the things that I already tried.

1) replaced all the oracle dll's with 32 bit oracle dll i.e 2.112.3.0

I have 32 bit client installed on 64 bit machine. The operating system is windows 7.

2) compile each individual project individually. Deleted all the oracle dependent files dll and then added the 2.112.3.0 dll's individually and then compiled each project

3) Register the 32 bit dll on GAC using this statement gacutil /i %ORA_HOME4%odp.netin4Oracle.DataAccess.dll

gacutil /i %ORA_HOME4%asp.netin4oracle.web.dll

for the above two statements, I copied the gacutil.exe from c:Program Files(x86)Microsoft sdkwindowsv7.0ABinNETFX4.0 ToolsX64 to C: drive and then

I executed the above two statement:

gacutil /i %ORA_HOME4%odp.netin4Oracle.DataAccess.dll gacutil /i %ORA_HOME4%asp.netin4oracle.web.dll when I executed the above two statements, I didn't get any message, I executed them in Dos windows under administrator privilege.

4) I also deleted all the Temporary ASP.net files from this location

c:windowsMicrosoft.NetV4.0.30319emporary ASP.net files I also changed the web application build Platform target to X86, Originally, it was at "ANy CPU". out of frustration, I also tried changing the platform target to X64 and then I got the error message saying

" Cold not load file or assemble . webapp" or one of its dependencies. An attempt was made to load a program with an incorrect format.

I don't have IIS installed on my computer, I am running this application in visual studio 2010 so I think it will be using the inbuilt IIS that comes with visual studio.

I spend lot of hours resolving this issue, but still getting the same error again and again.

any help or hint will be highly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this: Open IIS Manager, change application pool's advance setting, change Enable 32 bit Application to false.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...