Print Page | Close Window

RegistryPermission request

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=527
Printed Date: 11-Jun-2026 at 10:38am


Topic: RegistryPermission request
Posted By: greenman
Subject: RegistryPermission request
Date Posted: 26-Oct-2007 at 4:56pm
I've deployed an asp.net site with devforce 3.5.2.3 express. In my development workstation, all is working well, when I deploy the site in the hosting machine this exception bangs:
 
[SecurityException: Request for the permission of type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +59
   Microsoft.Win32.RegistryKey.CheckSubKeyReadPermission(String subkeyName) +90
   Microsoft.Win32.RegistryKey.CheckOpenSubKeyPermission(String subkeyName, Boolean subKeyWritable) +25
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +69
   IdeaBlade.Util.AuthHelper.GetRegKey(Boolean pWritable) +29
   IdeaBlade.Util.AuthHelper.InitializeFromRegistry() +12
   IdeaBlade.Util.AuthHelper.get_Instance() +131
   IdeaBlade.Util.IdeaBladeConfig.LoadLicenseInfo(Assembly pAssembly) +36
   IdeaBlade.Util.IdeaBladeConfig.Initialize() +212
   IdeaBlade.Util.IdeaBladeConfig.get_Instance() +48
   IdeaBlade.Persistence.DataSourceResolver.GetProbedResolver() +19
   IdeaBlade.Persistence.DataSourceResolver..ctor(String pDataSourceExtensionName) +63
   IdeaBlade.Persistence.PersistenceManager..ctor(Boolean pShouldConnect, String pDataSourceExtension, PersistenceServiceOption pPersistenceServiceOption) +201
 
It seems that devForce try to get the licence key or something else in the registry and causes the error. I have absolutely no control over the hosting machine. Thank you for your help.



Replies:
Posted By: davidklitzke
Date Posted: 29-Oct-2007 at 8:16am
The Persistence Manager must be given full trust.  Among other things, it needs full trust to read from and write to the registry.


Posted By: davidmgarrett
Date Posted: 09-Mar-2008 at 9:13pm
I'm using DevForce Expres version 3.6.0.2, and I'm having similar problems running in a hosted environment,
although my failure occurs during initialization:
 
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   IdeaBlade.Util.IdeaBladeConfig.Initialize() +0
   IdeaBlade.Util.IdeaBladeConfig.get_Instance() +48
   IdeaBlade.Persistence.DataSourceResolver.GetProbedResolver() +19
   IdeaBlade.Persistence.DataSourceResolver..ctor(String pDataSourceExtensionName) +66
   IdeaBlade.Persistence.PersistenceManager..ctor(Boolean pShouldConnect, String pDataSourceExtension, PersistenceServiceOption pPersistenceServiceOption) +201

This seems like quite a shortcoming- are there plans to remedy it soon- perhaps in DevForce EF?
I have developed an extensive website only to find that I will have to completely rewrite the DAL if I can't deploy DevForce.  Hosting sites are certainly not going to grant read/write privs to the system registry on a shared server.
 
Are there any work-arounds you can suggest?
 
By the way, I love the simplicity of DevForce, and I caught the Microsoft Webinar on DevForce EF in February.
I look forward to your response.
 
Thanks in advance!
 


Posted By: davidklitzke
Date Posted: 10-Mar-2008 at 11:16am
This is a limitation of AspDataSource on DevForce 3.x.  It must run in a Full Trust environment.  It is not just RegistryPernission either.  It needs the ability to do Reflection as well.  The changes needed to change this would be enormous, so don't expect this behavior to change in DevForce 3.x.
 
The good news is that we will have a solution to this problem in some future version of DevForce EF, probably one that incorporates SilverLight technology



Print Page | Close Window