1
votes

I'm not an Oracle guy and need to use it from Visual Studio. I installed Oracle Data Tools for Visual Studio 2015 but can't get by some odd error messages. The first time I start VS and try to add a new connection (any connection), I get the message:

Oracle Data Provider for .NET has been installed without a machine-wide configuration. However, a version of Oracle Data Provider for .NET has been detected in the Global Assembly Cache which may be incompatible. Please remove Oracle Data Provider for .NET from the Global Assembly Cache and restart Visual Studio.

This is odd, because I just did exactly what the message said. The next time I started VS, the error popped up again.

If I OK that message, I get another one:

Failed to find the default tnsnames.ora. Could not load type OracleInternal.Common.ConfigBaseClass' from assembly Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=Neutral, PublicKeyToken=89b483f429c47342

I'm not at all sure what that means.

Any ideas out there?

UPDATES:

Didn't create tnsnames.ora (don't know how to). Did I miss a step in installation? (Don't remember that being mentioned). In the machine config I have:

<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

Oracle is not found in the user.config file. the dll info:

C:\Program Files (x86)\Microsoft Visual Studio 14.0>gacutil /l Oracle.ManagedDat
aAccess
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=8
9b483f429c47342, processorArchitecture=MSIL

No .NET config file at this point. in VS I'm just trying to connect with server Explorer

2
Findings back in main post - user1443098
This does not match. You copy/paste oracle.dataaccess but query GAC for "Oracle. ManagedDataAccess" - Wernfried Domscheit
Ok thanks for pointing that out. I'm not sure what that means. I naively expected odt to work out of the box. Now I don't know what I need to do. I want it to work without becoming an Oracle DBA. - user1443098
Did you check value for /configuration/oracle.manageddataaccess.client/version/settings/setting/@name=TNS_ADMIN in your .NET config file? Does it show the folder where your tnsnames.ora file is stored. In order to create a tnsnames.ora file, ask your DBA. - Wernfried Domscheit
Yes, it does, and tnsnames.ora is there. - user1443098

2 Answers

1
votes

Did you create any tnsnames.ora file? If yes, where did you save it. Unlike other clients, ODP.NET Managed Driver does not use TNS_ADMIN variable from environment settings or Registry.

Check content of <oracle.manageddataaccess.client> element in your .NET config files %windir%\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config, resp. of <oracle.manageddataaccess.client> element in your .NET config files %windir%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config and/or local config files (user.config and web.config)

See Data Provider for .NET Developer's Guide for more information.

Compare configuration in .NET config file , e.g.

<configuration>
  <configSections>
    <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

with actually installed DLL, e.g.:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>gacutil /l Oracle.ManagedDataAccess
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.18020
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL
  Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL

Number of items = 2

C:\Program Files (x86)\Microsoft Visual Studio 11.0>
-1
votes

The TNS names error is due to a missing TNSNames.ora file, usually found in the C:\app\userprofile\product\11.2.0\client_1\network\admin for Oracle 11g. The TNSnames.ora file contains the database connection information. You didn't say what version of the Oracle Client you installed, so the version number may be different. I always install a full client and during that process the TNS configuration program runs and installs and configures the TNSNames.org file. I'm not familiar with Oracle Data Tools for Visual Studio 2015, but there must be some sort of configuration tool to connect you with the database.

To install the full client, you can download the install from Oracle.com at this link:

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

Installing the full client will also resolve the GAC problem as well. Apparently the version installed is not compatible with your database installation.