StrataFrame Forum

RegistryKey: Access denied under Vista

http://forum.strataframe.net/Topic18446.aspx

By Ralph Rutschmann - 8/12/2008

Hello all,

my app is due to test on different machines now and works find under XP Prof. Unfortunately not under Vista Ultimate (no other version of this OS to test on this time). I'm logged on as admin. All is working as expected, except the SecurityDialog. As soon as I try do close that dialog, I get an exception:

UnauthorizedAccessException
  Der Zugriff auf den Registrierungsschlüssel HKEY_LOCAL_MACHINE\Software\MicroFour\StrataFrameSecurity\SecurityDialog wurde verweigert.

Source     : mscorlib

Stack Trace:
   bei Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   bei Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
   bei Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
   bei Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
   bei MicroFour.StrataFrame.Win32.RegistryRepository.WriteValue(String KeyPath, String ValueName, Int32 Value)
   bei MicroFour.StrataFrame.Win32.RegistryRepository.WriteValue(String ValueName, Int32 Value)
   bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.SaveSizeAndLocation()
   bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnFormClosing(FormClosingEventArgs e)
   bei System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)

I use the SecurityDialog 'as is' and did no changes. Does anybody know why I get the above error and / or how to avoid it?

Thank you very much.

Best regards,

Ralph

By Ivan George Borges - 8/13/2008

Hi Ralph.

Have a look at the link bellow. It might help you.

http://forum.strataframe.net/FindPost10345.aspx

Cheers.

By Geoff Hirst - 8/13/2008

Guys,

This is REALLY interesting. My application has been out in the wild for about 4 months and I have never come across this issue. Until today. Now, does anyone have any details on whether Microsoft's 'patch Tuesday' occurred yesterday? If so, is there any possibility that something may have been changed by them, that causes this to happen?

thanks

G.

By Geoff Hirst - 8/13/2008

Hi,

My enthusiasm to paint MS for this one, is alas shortlived.

It would seem that an update to SF in June may well solve this issue.

'http://forum.strataframe.net/FindPost17255.aspx'

Hope this helps.

G.

By Trent L. Taylor - 8/13/2008

Geoff is correct on this.  This is actually an environment issue as this does actually work on Vista Ultimate (as this is actually what I run) as well as other OS's.  However, we have added the ability to get around this error by forcing the registry to save over on the CURRENT_USER instead of the LOCAL_MACHINE.  Just set this:

MicroFour.StrataFrame.Security.SecurityBasics.ForceCurrentUserOnRegistrySettings = True

A good place to set this would be in the AppMain.vb or program.cs file in either the InitApplication or SetDataSources methods.

By Ralph Rutschmann - 8/13/2008

Hello Trent,

thank you very much for the quick fix! Smile

I tried it already and it works without any error.

Friendly greetings,

Ralph