visual studio 2012 - System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, ... when running unit tests -


i'm trying run unit tests perform execute sql commands directly oracle database , following exception when unit tests started:

testmethod1 threw exception:
system.io.filenotfoundexception: not load file or assembly 'oracle.dataaccess, version=4.112.3.0, culture=neutral, publickeytoken=89b483f429c47342' or 1 of dependencies. system cannot find file specified.

i have oracle.dataaccess in project references (added through nuget) , have have oracle data provider installed.

i have other projects using oracle.dataaccess run in machine without problems. seems microsoft.net unit test framework (mstest) not able load assembly.

this log taken fusion log viewer:

*** assembly binder log entry  (23/08/2013 @ 04:50:07 p.m.) ***  operation failed. bind result: hr = 0x80070002. system cannot find file specified.  assembly manager loaded from:  c:\windows\microsoft.net\framework\v4.0.30319\clr.dll running under executable  c:\program files (x86)\microsoft visual studio 11.0\common7\ide\qtagent32_40.exe --- detailed error log follows.   === pre-bind state information === log: user = ... log: displayname = oracle.dataaccess, version=4.112.3.0, culture=neutral, publickeytoken=89b483f429c47342  (fully-specified) log: appbase = file:///...c:/<solution_folder>.../testresults/.../out log: initial privatepath = null log: dynamic base = null log: cache base = null log: appname = qtagent32_40.exe calling assembly : ...<project_name>..., version=1.0.0.0, culture=neutral, publickeytoken=null. === log: bind starts in default load context. log: using application configuration file: c:\...<solution_folder>...\testresults\...\out\...<project_name>....dll.config log: using host configuration file:  log: using machine configuration file c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config. log: post-policy reference: oracle.dataaccess, version=4.112.3.0, culture=neutral, publickeytoken=89b483f429c47342 log: gac lookup unsuccessful. log: attempting download of new url file:///c:/...<solution_folder>.../testresults/.../out/oracle.dataaccess.dll. log: attempting download of new url file:///c:/...<solution_folder>.../testresults/.../out/oracle.dataaccess/oracle.dataaccess.dll. log: attempting download of new url file:///c:/...<solution_folder>.../testresults/.../out/oracle.dataaccess.exe. log: attempting download of new url file:///c:/...<solution_folder>.../testresults/.../out/oracle.dataaccess/oracle.dataaccess.exe. log: probing urls attempted , failed. 

it states assembly not found in gac, did found it: c:\windows\microsoft.net\assembly\gac_64\oracle.dataaccess\v4.0_4.112.3.0__89b483f429c47342\oracle.dataaccess.dll\

it's worth noting above log shows qtagent32_40.exe though have selected in visual studio menu test -> test settings -> default processor architecture -> x64. before doing getting badimageformatexception instead.

additional notes:

  • the oracle data provider have installed 64 bit version.
  • the reference has copy local=true

found problem.

there .testsettings file forcing tests run in 32 bit mode regardless of me selecting test -> test settings -> default processor architecture -> x64.

the weird thing if select x86 proper badimageformatexception @ runtime, while if architecture forced in .testsettings file filenotfoundexception, little misleading.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -