Search code examples
c#oracle-databaseentity-frameworkvisual-studio

Could not find file 'C:\SomePath\Oracle.DataAccess.Common.Configuration.Section.xsd' when connecting to Oracle server


In my current project I've had some problems connecting Entity Framework 6 to our production Oracle database.

Steps taken to the point where I am right now:

  1. Installed latest (ODAC121010Beta2_64bit) oracle client with Entity Framework 6 support
  2. Add a reference to C:\app\client\\product\12.1.0\client_1\odp.net\managed\common\Oracle.ManagedDataAccess.dll (copy local = false)
  3. Add a reference to C:\app\client\\product\12.1.0\client_1\odp.net\managed\common\EF6\Oracle.ManagedDataAccess.EntityFramework.dll (copy local = true) edit: strangly enough this was set 'true', not false as expected.
  4. Manually added my provider

    <providers>
      <provider invariantName="Oracle.ManagedDataAccess.Client"
        type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework" />
    </providers>
    

Using this setup Visual Studio can connect to our Oracle db and build my models. Great!

But when I run my application it fails during my first data fetch:

    Exception:Caught: "Could not find file 'C:\PATH_TO_MY_PROJECT\bin\Debug\Oracle.DataAccess.Common.Configuration.Section.xsd'." (System.IO.FileNotFoundException)

The file Oracle.DataAccess.Common.Configuration.Section.xsd is located in the same path as my Oracle.ManagedDataAccess.dll I have referenced to among some other files.

My PATH environment holds

    C:\app\client\<USER>\product\12.1.0\client_1
    C:\app\client\<USER>\product\12.1.0\client_1\bin

Google gives 0 results when searching on Oracle.DataAccess.Common.Configuration.Section.xsd, which may be the main reason for posting it here.

What is the suggested solution here? Why is it searching for these files in my DEBUG folder and not in the oracle driver folder?

edit Environment variables by request:

ADT_HOME=C:\Users\TDC\AppData\Local\Android\android-sdk
ALLUSERSPROFILE=C:\ProgramData
ANT_HOME=C:\apache-ant-1.9.3
APPDATA=C:\Users\TDC\AppData\Roaming
asl.log=Destination=file
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=WG-LT-TIELE
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
GIT_HOME=C:\Program Files (x86)\Git
HOMEDRIVE=U:
HOMEPATH=\
HOMESHARE=\\ASW-FILE\User Shared Folders$\TDC
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
LOCALAPPDATA=C:\Users\TDC\AppData\Local
LOGONSERVER=\\COS-DC-01
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\app\client\TDC\product\12.1.0\client_1;C:\app\client\TDC\product\12.1.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramFiles (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.7.0_55\bin;C:\Users\TDC\AppData\Local\Android\android-sdk\tools;C:\Users\TDC\AppData\Local\Android\android-sdk\platform-tools;C:\apache-ant-1.9.3\bin;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.7.0_55\bin;C:\Users\TDC\AppData\Local\Android\android-sdk\tools;C:\Users\TDC\AppData\Local\Android\android-sdk\platform-tools;C:\Program Files (x86)\Git\cmd\cmd;C:\Users\TDC\AppData\Roaming\npm;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=2a07
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\TDC\AppData\Local\Temp
TMP=C:\Users\TDC\AppData\Local\Temp
USERDNSDOMAIN=WGIT.LOCAL
USERDOMAIN=WGIT
USERDOMAIN_ROAMINGPROFILE=WGIT
USERNAME=TDC
USERPROFILE=C:\Users\TDC
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
windir=C:\Windows

Solution

  • The problem above occured when trying to run code using an Entity Framework connection to Oracle. This context/model was created using the same device as I'm running the code with.

    However.. when trying to recreate this context visual studio said that my provider was not compatible. When reinstalling the oracle driver for the 53th time the problem above was solved.

    So my problem has been resolved but I still have no idea on what the oracle installer did to solve it.