Data Access error when going from VS 2013 to VS 2017 RRS feed

  • Question

  • User-1188570427 posted


    I opened a web application that was usually used in VS 2013 to VS 2017. When I opened it up, it received this error message:

    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

    The .dlls were correct, my web.config pointed to the proper version, but the error continue to display even before hitting my default document page in the Page_Load() method.

    I was able to resolve it with this post:


    It seems the Oracle Data Access Component installation process using the "11.2 Release 3 ( with Xcopy Deployment" version is broken. To fix this you must register the missing assemblies in the GAC. To do this for this specific version run these commands from within an administrator console:
    md C:\Windows\assembly\GAC_32\Oracle.DataAccess\\
    copy %ORACLE_HOME%\odp.net\bin\4\Oracle.DataAccess.dll C:\Windows\assembly\GAC_32\Oracle.DataAccess\\
    md C:\Windows\assembly\GAC_32\Oracle.Web\\
    copy %ORACLE_HOME%\asp.net\bin\4\oracle.web.dll C:\Windows\assembly\GAC_32\Oracle.Web\\
    Note that this registers only the DLL's but not other languages resources. So, if you are using any another language than English (de, es, fr, it, ja, ko, pt-BR, zh-CHS, and zh-CHT), then you need to register these as well using the corresponding resource file.
    If you have Visual Studio installed on the machine, you can issue the following commands instead:
    gacutil /i %ORACLE_HOME%\odp.net\bin\4\Oracle.DataAccess.dll
    gacutil /i %ORACLE_HOME%\asp.net\bin\4\oracle.web.dll
    Note: look for gacutil.exe under the Visual Studio installation folder for it.
    Hope this helps.
    P.S. Or you can try this.

    Why would I have to do this for VS 2017 compared to it working without doing anything in VS 2013?

    Any ideas?

    Monday, July 13, 2020 1:51 AM


  • User-939850651 posted

    Hi tvb2727,

    Note: look for gacutil.exe under the Visual Studio installation folder for it.

    According to the case you provided, in the solution, solve your current problem by installing the missing dll dependency in the VS2017 installation folder.

    So I think there is no missing dll dependency in VS2013.

    Best regards,

    Xudong Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 14, 2020 7:18 AM