Licensing for Mono

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
nzsaint
Posts: 3
Joined: Thu 04 Aug 2011 02:24

Licensing for Mono

Post by nzsaint » Thu 04 Aug 2011 02:39

I have downloaded and installed the trial of dotConnect for Oracle Professional on my Windows development machine. I understand that at a minimum I need this version to use dotConnect on Mono using the 'Direct' method.

I am attempting to run my ASP.Net Web site (not Web Application) on Mono which is otherwise working ok using System.Data.OracleClient. When I attempt to use dotConnect I receive the error 'No access to the given key'. Other posts on this forum suggest I need to ensure I am using 'Direct=true' in my connection string (which I am) and also ensure the licensing is configured correctly. This is the part I am unclear on.

I have read the licensing documentation but it seems to talk about ASP.Net Web Applications as opposed to Web Sites. Essentially I believe that I must need to license my App_code.dll file which ultimately contains all the data access code.

Can anyone explain how I implement the licensing in this scenario (assuming that is what is causing this error)? We would like to purchase a full license once we have confirmed the trial verison works as intended.

Thanks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 04 Aug 2011 11:42

nzsaint wrote:I understand that at a minimum I need this version to use dotConnect on Mono using the 'Direct' method.
The Direct mode feature is available in the Developer, Professional, and Standard editions of dotConnect for Oracle: http://www.devart.com/dotconnect/oracle/editions.html.
nzsaint wrote:When I attempt to use dotConnect I receive the error 'No access to the given key'.
Seems like there is no valid Devart license resource in your application.
nzsaint wrote:I have read the licensing documentation but it seems to talk about ASP.Net Web Applications as opposed to Web Sites. Essentially I believe that I must need to license my App_code.dll file which ultimately contains all the data access code.
1. Adding the license resource to ASP.NET Web Application on Mono.
The license resource should be generated on Windows and added to the project on Linux as an embedded resource: http://www.devart.com/dotconnect/oracle ... ml#compile.
2. Adding the license resource to Web Site on Mono.
Open your Web Site in Visual Studio (on Windows) and generate App_Licenses.dll as described at http://www.devart.com/dotconnect/oracle ... g.html#asp.

nzsaint
Posts: 3
Joined: Thu 04 Aug 2011 02:24

Post by nzsaint » Thu 04 Aug 2011 22:19

Thanks for your reply.

I've have already read and followed the links you mentioned and it gives me this error. I will detail the steps I have taken so you can hopefully identify where I have gone wrong.

1) After dotConnect Professional Trial installation I added references to Devart.Data and Devart.Data.Oracle to my project from GAC.
2) Created a file 'licenses.licx' containing the text 'Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle' and added it to the root of my project. N.B I was not able to specify this file as an embedded resource as my project uses the ASP.Net Web Site template not the ASP.Net Web Application template in Visual Studio. To the best of my knowledge this option is not available for this project template type.
3) Ran 'Build Runtime Licenses' menu option on licenses.licx in my project- App_Licenses.dll was created in my Bin folder.
4) Compiled my application (I am using a precompiled ASP.Net Web Site) and copied compiled files to the relevant Apache folder on my Mono environment (running on OpenSUSE 11.1) .
5) Copied Devart.Data.dll and Devart.Data.Oracle.dll to the compiled files Bin folder in the Mono Environment.
6) Restarted Apache and tested.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 08 Aug 2011 15:29

1. Please specify the full text of the exception and your call stack.
2. Try specifying full type definition in licenses.licx: 'Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle, Version=6.30.196.0, Culture=neutral, PublicKeyToken=09af7300eec23701' (replace 6.30.196 with your current version) instead of 'Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle'.
3. Make sure that you have placed App_Licenses.dll in the folder of your application in the deployment environment. Is there any way to check if App_Licenses.dll is loaded to the process when your application is running?
4. Check the version of your Mono. There were problems with loading license information from resources in the previous versions of Mono: https://bugzilla.novell.com/show_bug.cgi?id=324427.
5. The following permissions are required by dotConnect for Oracle as partially trusted code (this is actual for web projects) in Direct mode: medium trust plus SocketPermission. Try granting more permissions (e.g., full trust level).
6. Tell us the version of your dotConnect for Oracle (x.xx.xxx).

nzsaint
Posts: 3
Joined: Thu 04 Aug 2011 02:24

Post by nzsaint » Tue 09 Aug 2011 02:43

Shalex wrote:1. Please specify the full text of the exception and your call stack.
System.Security.SecurityException
No access to the given key

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x00000] in :0
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir) [0x00000] in :0
at Microsoft.Win32.KeyHandler.Lookup (Microsoft.Win32.RegistryKey rkey, Boolean createNonExisting) [0x00000] in :0
at Microsoft.Win32.UnixRegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey rkey, System.String keyname, Boolean writable) [0x00000] in :0
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, Boolean writable) [0x00000] in :0
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name) [0x00000] in :0
at (wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey:OpenSubKey (string)
at Devart.Common.n.a (System.String& A_0, System.String& A_1) [0x00000] in :0
at Devart.Common.CRLicenseProvider.a (System.ComponentModel.LicenseContext A_0, System.Type A_1, System.String& A_2, System.Boolean& A_3, System.String& A_4, System.String& A_5) [0x00000] in :0
at Devart.Common.CRLicenseProvider.a (System.ComponentModel.LicenseContext A_0, System.Type A_1, Boolean A_2) [0x00000] in :0
at Devart.Common.CRLicenseProvider.a (System.ComponentModel.LicenseContext A_0, System.Type A_1, System.Object A_2, Boolean A_3) [0x00000] in :0
at Devart.Data.Oracle.OracleConnection.Open () [0x00000] in :0
at System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable dataTable, IDbCommand command, CommandBehavior behavior) [0x00000] in :0
at Devart.Data.Oracle.OracleDataAdapter.Fill (System.Data.DataTable dataTable, IDbCommand command, CommandBehavior behavior) [0x00000] in :0
at System.Data.Common.DbDataAdapter.Fill (System.Data.DataTable dataTable) [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable)
at BlueBox_XETableAdapters.CREDITCARDSTableAdapter.GetCreditCards () [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Shalex wrote: 2. Try specifying full type definition in licenses.licx: 'Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle, Version=6.30.196.0, Culture=neutral, PublicKeyToken=09af7300eec23701' (replace 6.30.196 with your current version) instead of 'Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle'.
I tried this but the same error is returned.
Shalex wrote: 3. Make sure that you have placed App_Licenses.dll in the folder of your application in the deployment environment. Is there any way to check if App_Licenses.dll is loaded to the process when your application is running?
Yes the App_Licenses.dll is in the Bin folder in the deployed environment and as far as I can tell it is loaded correctly.
Shalex wrote: 4. Check the version of your Mono. There were problems with loading license information from resources in the previous versions of Mono: https://bugzilla.novell.com/show_bug.cgi?id=324427.
I am using Mono 2.11 compiled from the GIT repositories.
Shalex wrote: 5. The following permissions are required by dotConnect for Oracle as partially trusted code (this is actual for web projects) in Direct mode: medium trust plus SocketPermission. Try granting more permissions (e.g., full trust level).
Full trust level is already set.
Shalex wrote: 6. Tell us the version of your dotConnect for Oracle (x.xx.xxx).
Devart.Data is 5.0.295.0. Devart.Data.Oracle is 6.30.196.0.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 11 Aug 2011 14:31

We will investigate the issue and notify you about the results as soon as possible.

Post Reply