Exception opening Oracle connect. from Visual studio package

Exception opening Oracle connect. from Visual studio package

Postby isenatore » Fri 03 Dec 2010 20:29

When open an OracleConnection from a Strong-name class library (in GAC) from Visual Studio Package i receive this exception.

If i use the class library from a console application work correctly.

The Exception is :

"The invoked member is not supported in a dynamic assembly."

at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
at Devart.Common.k.a(Assembly A_0)
at Devart.Common.b.a(LicenseContext A_0, Type A_1, String& A_2, String& A_3, String& A_4)
at Devart.Common.b.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4, String& A_5)
at Devart.Common.b.a(LicenseContext A_0, Type A_1, Boolean A_2)
at Devart.Common.b.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3)
at Devart.Data.Oracle.OracleConnection.Open()
at HyperDev.Data.OracleDatabase.GetConnection()
at HyperDev.Data.Database.CheckConnection(Exception& exception)
isenatore
 
Posts: 1
Joined: Fri 03 Dec 2010 20:12

Postby Shalex » Mon 06 Dec 2010 14:27

Please add the license resource to your class library as it is described at http://www.devart.com/dotconnect/oracle/docs/Licensing.html#lib. The name of Visual Studio's executable file is devenv.exe. If this doesn't help, try to make the minimal installation of dotConnect for Oracle on the target machine. Notify us about the results.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Exception opening Oracle connect. from Visual studio package

Postby benoygeorge » Tue 22 Apr 2014 00:27

I have the exact same error in one of the three environments.
DEV - Works Fine
QA - Fails with the error described here
PROD - Works Fine.

I am using dcoracle77pro 7.7.224.
the connection to oracle is being made from a WCF Service. We enabled remote debugging on the QA IIS Server and was able to attach to the process for troubleshooting. The step that causing the exception is OracleConnection.Open()

Type : System.NotSupportedException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : The invoked member is not supported in a dynamic assembly. Source : mscorlib Help link : Data : System.Collections.ListDictionaryInternal TargetSite : System.String get_Location()
benoygeorge
 
Posts: 1
Joined: Tue 22 Apr 2014 00:10

Re: Exception opening Oracle connect. from Visual studio package

Postby Pinturiccio » Wed 23 Apr 2014 14:19

When you create an application that uses Devart assemblies, it must have a license resource. License information is a specially formed embedded resource. It is checked when a connection is opened.
dotConnect for Oracle includes License Wizard that helps you configure license information. To invoke the wizard, select Oracle -> License Information from the Visual Studio Tools menu. Then click the Fix buttons in the dialog box and follow the wizard's instructions. After the wizard finishes its work, rebuild your application. For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/?Licensing.html

Since WCF service is a dll, the licensing is added in the same way as for a class library. Class library licensing is a special case. In addition to the licenses.licx file, you need to create a licenses.config file with the list of the names of executable files that will work with the library. License Wizard eases adding the license resource to the class library as well. For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/Licensing.html#lib

Please make sure that your project contains the license resource.
Pinturiccio
Devart Team
 
Posts: 2024
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle