I am using the AtomsFramework on a webserver but get a "security exception" when initalising the persistence broker. I think that it is trying to set a registry key in CPersistenceBroker.InitPerformanceCounters() but the registry is restricted Is there any way to avoid changing the registry.
I have included the error details
Many Thanks
Ian
Exception Details
----------------
System.Security.SecurityException: Requested registry access is not allowed.
Others have reported this problem before. To fix it, I've added errors handlers around all the performance counter code to catch the errors and continue on without a problem.
Unfortunately, you will need to get the latest source code from CVS for this fix as I haven't rolled it up into a new release yet.
If you don't have CVS access or can't download the code let me know and I'll send you a zip file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We are using the Framework in this project as a test case to see if we can roll it out to our other projects. It's all looking good so far.
We use Nunit extensively with all our projects. When I get some time on my hands, I will see if I can offer any help on this side of things. In the meantime keep up the good work
Many Thanks
Ian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've run into the same issue. The problem seems to be an assembly rights issue (in my case, I'm testing things with the whole framework included in my main project)
Error trapping the perfcounters will work, but wouldn't it be better to add a config to the DATABASE element of the Mapping file to allow you to turn on/off counter support?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem with adding a flag to the XML is that it's possible to have multiple databases. If one database has the flag on and one has it off which do I use?
It also means an extra thing to check for when doing configurations, and I don't really like the solution. I would much rather it be a setting in the persistence broker that you can turn on/off via a property at run time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am using the AtomsFramework on a webserver but get a "security exception" when initalising the persistence broker. I think that it is trying to set a registry key in CPersistenceBroker.InitPerformanceCounters() but the registry is restricted Is there any way to avoid changing the registry.
I have included the error details
Many Thanks
Ian
Exception Details
----------------
System.Security.SecurityException: Requested registry access is not allowed.
Stack Trace
------------
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Diagnostics.PerformanceCounterLib.CreateRegistryEntry(String machineName, String categoryName, CounterCreationDataCollection creationData, Boolean& iniRegistered) +184
System.Diagnostics.PerformanceCounterLib.RegisterCategory(String machineName, String categoryName, String categoryHelp, CounterCreationDataCollection creationData) +43
System.Diagnostics.PerformanceCounterCategory.Create(String categoryName, String categoryHelp, CounterCreationDataCollection counterData, String machineName, String localizedIniFilePath) +925
System.Diagnostics.PerformanceCounterCategory.Create(String categoryName, String categoryHelp, CounterCreationDataCollection counterData) +17
AToMSFramework.CPersistenceBroker.InitPerformanceCounters() +856
AToMSFramework.modPersistenceBrokerSingleton.getOrSetPBInstance(CPersistenceBroker& pb) +138
AToMSFramework.CPersistenceBroker.init(String xmlfile) +26
payments.deposit.Page_Load(Object sender, EventArgs e) +62
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
Hi Ian,
Others have reported this problem before. To fix it, I've added errors handlers around all the performance counter code to catch the errors and continue on without a problem.
Unfortunately, you will need to get the latest source code from CVS for this fix as I haven't rolled it up into a new release yet.
If you don't have CVS access or can't download the code let me know and I'll send you a zip file.
Hi Richard,
That worked like a dream.
We are using the Framework in this project as a test case to see if we can roll it out to our other projects. It's all looking good so far.
We use Nunit extensively with all our projects. When I get some time on my hands, I will see if I can offer any help on this side of things. In the meantime keep up the good work
Many Thanks
Ian
I've run into the same issue. The problem seems to be an assembly rights issue (in my case, I'm testing things with the whole framework included in my main project)
Error trapping the perfcounters will work, but wouldn't it be better to add a config to the DATABASE element of the Mapping file to allow you to turn on/off counter support?
The problem with adding a flag to the XML is that it's possible to have multiple databases. If one database has the flag on and one has it off which do I use?
It also means an extra thing to check for when doing configurations, and I don't really like the solution. I would much rather it be a setting in the persistence broker that you can turn on/off via a property at run time.