8 Replies Latest reply: Sep 11, 2012 10:25 AM by user6480755 RSS

    ODP.NET4 required .NET2.0?

      OS : Windows XP
      .NET : .NET 4 Client Profile only.(not installed .NET2/3.5)

      ODAC XCopy download. install.bat odp.net4 ~ ~ true

      run my app, OracleConnection creating Type Initializer Error.

      but my app succeed, after the .NET 3.5SP1 installation.

      OraOps11w.dll version
      Oracle.DataAccess.dll version

      Because the version of the OraOps11w.dll is different?
        • 1. Re: ODP.NET4 required .NET2.0?
          Alex.Keh .Product.Manager-Oracle
          ODP.NET 2 is required for .NET Framework 2.x and 3.x. ODP.NET 4 is required for .NET Framework 4.x and above.

          Your app is probably using ODP.NET 2.x and the ODP.NET 2.x dependent DLLs. The app wouldn't work if it was using Oracle.DataAccess.dll 4.x with 2.x dependent DLLs.
          • 2. Re: ODP.NET4 required .NET2.0?
            hi Alex.

            reply thx.

            xp env is installed odp.net4 only.(don't install odp.net2)

            minimum code run result.
            mscorelib, Version=, ...
            Oracle.DataAccess, Version=, ...
            'Oracle.DataAccess.Client.OracleConnection' type iniitalize error ....
            but after installing the.NET3.5SP1 if Windows Update,not throw exception.

            [minimum code]
            using System;
            using Oracle.DataAccess.Client;

            class Program {
            static void Main(string[] args) {
            try {
            var connStr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=service name)));User Id=user;Password=pass;";
            using (var conn = new OracleConnection(connStr))
            using (var cmd = new OracleCommand(@"select SYSDATE from dual", conn)) {
            catch (Exception e) {
            • 3. Re: ODP.NET4 required .NET2.0?
              Alex.Keh .Product.Manager-Oracle
              .NET Framework 3.5 must use ODP.NET for .NET 2. It can't use ODP.NET for .NET 4, which is is why you have an exception.
              • 4. Re: ODP.NET4 required .NET2.0?
                I going to use .NET 4 Client Profile, Oracle.DataAccess.dll (ver 4.112.3).but had been using ODP.NET2 within do not know?
                • 5. Re: ODP.NET4 required .NET2.0?
                  Hi Alex,

                  i have similar issue.
                  My Xp production machine have installed onlt .net 4 (extended) and i develop application on dev machine with Oracle.DataAccess.Dll
                  But i have same exception.
                  If i install .net 3.5 it work fine.

                  You have any idea?

                  • 6. Re: ODP.NET4 required .NET2.0?
                    Alex.Keh .Product.Manager-Oracle
                    We've seen this type of issue before if a machine is missing Visual C++ 2005 SP 1 redistributable package, which you can download here for 32-bit.

                    You're not missing .NET 3.5 per se. Rather, I believe .NET 3.5 includes this redistributable.

                    ODP.NET consists of managed and unmanaged code. The unmanaged code relies on that specific version of the VC++ redistributable package.
                    • 7. Re: ODP.NET4 required .NET2.0?
                      hi. Alex.

                      ・Windows XP
                      ・.NET 4 Client Profile
                      ・ODP.NET 4
                      ・VC++ redistributable package

                      Running my app!

                      • 8. Re: ODP.NET4 required .NET2.0?
                        Hi Alex.

                        Thanks for your response.
                        Now i try with c++ redistributable package.

                        Many thanks!

                        Edited by: user6480755 on Sep 11, 2012 5:25 PM