.NET Framework Developer Center > .NET Development Forums > POS for .NET > Failed to open registry key HKEY_LOCAL_MACHINE\SOFTWARE\POSfor.NET\ControlAssemblies (with Windows7)
Ask a questionAsk a question
 

AnswerFailed to open registry key HKEY_LOCAL_MACHINE\SOFTWARE\POSfor.NET\ControlAssemblies (with Windows7)

  • Monday, November 02, 2009 9:37 PMWoodchux Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    We are receiving the following error when running POS for .NET 1.12 on Windows 7 x86 version.  My guess is that it is a permissions related error caused by UAC in Windows7.  The code worked fine under Windows XP.  Does anyone have any idea about how to resolve this?



    An exception of type 'System.TypeInitializationException' occurred and was caught.

    ----------------------------------------------------------------------------------

    11/02/2009 13:32:33

    Type : System.TypeInitializationException

    Message : The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception.

    Source : Microsoft.PointOfService

    Help link :

    TypeName : Microsoft.PointOfService.Management.Explorer

    Data : System.Collections.ListDictionaryInternal

    TargetSite : Microsoft.PointOfService.Management.Explorer CreateExplorer()

    Stack Trace :    at Microsoft.PointOfService.Management.Explorer.CreateExplorer()

       at Microsoft.PointOfService.PosExplorer.LoadExplorer()

       at Microsoft.PointOfService.PosExplorer.Initialize()

       at Microsoft.PointOfService.PosExplorer..ctor(ISynchronizeInvoke synchronizingObject)

       at Maddog.WePOSDevices.CardReader..ctor(ISynchronizeInvoke sinvoke)

       at Maddog.Client.Contact.CustomerQuickAdd.CustomerQuickAdd_Load(Object sender, EventArgs e)

     

    Additional Info:

     

    MachineName : PC4116
    TimeStamp : 11/2/2009 7:32:33 PM
    FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
    AppDomainName : Maddog.Client.exe
    ThreadIdentity :
    WindowsIdentity :  
    Inner Exception

     ---------------

     Type : Microsoft.PointOfService.PosLibraryException

     Message : Failed to open registry key HKEY_LOCAL_MACHINE\SOFTWARE\POSfor.NET\ControlAssemblies.

     Source : Microsoft.PointOfService

     Help link :

     Data : System.Collections.ListDictionaryInternal

     TargetSite : Microsoft.PointOfService.Management.ServiceObjectCollection Scan()

     Stack Trace :    at Microsoft.PointOfService.Management.AssemblyLoader.Scan()

        at Microsoft.PointOfService.Management.AssemblyLoader.Scan()

        at Microsoft.PointOfService.Management.Explorer.ScanForSOAssemblies()

        at Microsoft.PointOfService.Management.Explorer.Refresh()

        at Microsoft.PointOfService.Management.Explorer..ctor()

        at Microsoft.PointOfService.Management.Explorer..cctor()


    ---------------------------
    OK  
    ---------------------------

Answers

  • Friday, November 06, 2009 7:42 PMWoodchux Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    My theory is that if POS for .NET is installed and user does not have local admin rights, it will not install correctly and unfortunately will not throw any type of error under a silent install.

    Most probably the registry keys are not getting installed correctly under Windows 7 because of some additional security on the client machine there, but Windows XP doesnt have the same restrictions.
    • Marked As Answer byWoodchux Monday, November 09, 2009 11:54 PM
    •  

All Replies

  • Wednesday, November 04, 2009 7:22 PMYortAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Does it work if you disable UAC or change your application to elevate itself ? Seems odd that it would be a UAC issue since you can use Pos .Net as a non-admin user under XP which should be very similar to a UAC enabled account that hasn't been elevated. It is of course possible they've changed the permissions on the registry keys and that combined with UAC is causing the problem.

    You could using regedit to modify the permissions on the registry key so everyone has read access, that shoudl still be secure and allow the app to run.

  • Friday, November 06, 2009 4:15 AMSylvester-MSFTMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Also check to make sure the registry key was not deleted:

    HKEY_LOCAL_MACHINE\SOFTWARE\POSfor.NET\ControlAssemblies

  • Friday, November 06, 2009 7:42 PMWoodchux Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    My theory is that if POS for .NET is installed and user does not have local admin rights, it will not install correctly and unfortunately will not throw any type of error under a silent install.

    Most probably the registry keys are not getting installed correctly under Windows 7 because of some additional security on the client machine there, but Windows XP doesnt have the same restrictions.
    • Marked As Answer byWoodchux Monday, November 09, 2009 11:54 PM
    •  
  • Friday, November 06, 2009 7:47 PMYortAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Not surprising, most applications and libraries require installation under an admin account in order to update the system and since Vista that has included elevation.

    Try installing it with UAC turned off, or by right clicking the exe and saying 'run as administration'.