2 Replies Latest reply: Oct 5, 2012 11:36 AM by 965954 RSS

    Could not load file or assembly 'Oracle.ManagedDataAccessDTC'

      I'm a little bit stuck... I've been trying to replace System.Data.OracleClient in my application for a while now, and was very encouraged to see a managed DLL option.

      I have followed the quick start instructions in the readme file, but my site returns this error on every page:

      Could not load file or assembly 'Oracle.ManagedDataAccessDTC' or one of its dependencies. An attempt was made to load a program with an incorrect format.

      My development machine is 64 bit, and my server is 32 bit. I've tried to include either version into the /bin directory in my web application, but there is no change to the error message. I've also tried setting "promotable transaction=local" in my connection string to try and mitigate the need for this assembly, and that doesn't change the error.

      Interestingly (to others... to me it's terrifying) my application will no longer run even if I remove all references to the managed DLL, remove all 'using' statements, and try to revert my site back to the way it was... I am still getting the same error on load for any page.

      As you might expect, I am a complete, total noob with Oracle. I'm about as lost as can be.
        • 1. Re: Could not load file or assembly 'Oracle.ManagedDataAccessDTC'
          As a followup to this - I deleted everything off the server and republished. Then, watching the video, I followed along step by step. Everything appeared to work fine for my test page.

          I am a little bit lost however, trying to implement this in the rest of my application. The documentation doesn't have an example (that I can see, anyway) for how to reference the managed client in the <connectionStrings> section of my web.config file.

          I am also not too clear, if I need to have the tnsnames.ora file in my /bin/debug folder, if I have defined a connection string like this.

          <add name="MYNAME" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MYHOST)(PORT=MYPORT))(CONNECT_DATA=(SERVICE_NAME=MYSERVICENAME)));User Id=USERID;Password=PASSWORD;Persist Security Info=False" providerName="Oracle.ManagedDataAccess.Client" />

          (actual values in the above tag removed to protect the innocent...)

          Is Oracle.ManagedDataAccess.Client the preferred providerName for this tag?

          Currently, I am getting the following error:

          Unable to find the requested .Net Framework Data Provider. It may not be installed
          • 2. Re: Could not load file or assembly 'Oracle.ManagedDataAccessDTC'
            I ended up adding this to the <configuration> section in web.config:

            <remove invariant="Oracle.ManagedDataAccess" />
            <add name="Oracle Managed Data Provider for .NET" invariant="Oracle.ManagedDataAccess" description="Oracle Managed Data Provider for .NET" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" />

            The connection string ended up looking like this:

            <add name="ConnectionName" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=xxxx)));User Id=xxxx;Password=xxxx;Persist Security Info=False" providerName="Oracle.ManagedDataAccess" />

            If you reference the provider in an asp:SqlDataSource tag, be sure to reference it as:


            Hopefully this helps someone else out!