Professional Web Applications Themes
  1. #1

    Default Re: Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is denied

    Hello z,

    yes you have to pre-register the COM+ component - annotate as much as possible
    with attributes in your ServicedComponent and use regsvcs.exe from the command
    line at install time.
    Dominick Baier - DevelopMentor

    Dominick Guest

  2. #2

    Default Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is denied


    using enterprise services from dot-net:

    on windows application it did OK.
    on ASP.NET i get the folowing error. (see in the end)

    Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is

    if i use the components services MMC snap in to create a new application
    with the required DLL, the ASP.NET call does fine.

    what are the steps in order for the ASP.NET process to make the COM+
    (enterprise services) registration successfully as a windows application?
    should this be the way?
    or should it be pre-configured in the com+ catalog? and if so what is the
    recomended way to use a command line tool for this?

    also is there some XP/Win2003 server differences that should be considered?


    Server Error in '/EntSrvcTest1-direct' Application.

    Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccesception: Access to the
    registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is denied.

    ASP.NET is not authorized to access the requested resource. Consider
    granting access rights to the resource to the ASP.NET request identity.
    ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
    Network Service on IIS 6) that is used if the application is not
    impersonating. If the application is impersonating via <identity
    impersonate="true"/>, the identity will be the anonymous user (typically
    IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    appropriate user or group. Highlight the ASP.NET account, and check the
    boxes for the desired access.

    Source Error:

    Line 45:
    Line 46: Private Sub Button1_Click(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles Button1.Click
    Line 47: Dim oTran As New cTran
    Line 48: oTran.MakeChange()
    Line 49:

    Source File: c:\inetpub\wwwroot\EntSrvcTest1-direct\WebForm1.aspx.vb
    Line: 47

    Stack Trace:

    [UnauthorizedAccesception: Access to the registry key
    HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is denied.]
    Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +74
    Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503
    System.Runtime.InteropServices.RegistrationService s.RegisterManagedType(Type
    type, String strAsmName, String strAsmVersion, String strAsmCodeBase, String
    strRuntimeVersion) +216
    System.Runtime.InteropServices.RegistrationService s.RegisterAssembly(Assembly
    assembly, AssemblyRegistrationFlags flags) +258
    System.EnterpriseServices.RegistrationDriver.Class icRegistration(Assembly
    asm) +100

    [RegistrationException: Failed to register assembly 'EntSrvcTest1-direct,
    Version=1.0.2084.17791, Culture=neutral, PublicKeyToken=1734505f1056dd4f'.]
    System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
    reqMsg, IMessage retMsg) +264
    System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
    msgData, Int32 type) +877
    System.EnterpriseServices.RegistrationHelperTx.Ins tallAssemblyFromConfig(RegistrationConfig&
    regConfig, Object sync) +0
    System.EnterpriseServices.RegistrationHelper.TryTr ansactedInstall(RegistrationConfig
    regConfig) +215
    System.EnterpriseServices.RegistrationHelper.Insta llAssemblyFromConfig(RegistrationConfig&
    regConfig) +241
    System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
    assembly, String& application, String partition, String& tlb,
    InstallationFlags installFlags) +116
    System.EnterpriseServices.RegistrationHelper.Insta llAssembly(String
    assembly, String& application, String& tlb, InstallationFlags installFlags)
    System.EnterpriseServices.RegistrationHelper.Syste m.EnterpriseServices.Thunk.IThunkInstallation.Defa ultInstall(String
    asm) +43
    System.EnterpriseServices.Thunk.Proxy.RegisterAsse mbly(Assembly assembly)
    System.EnterpriseServices.Thunk.Proxy.LazyRegister (Guid id, Type
    serverType, Boolean checkCache) +200
    System.EnterpriseServices.Thunk.Proxy.CoCreateObje ct(Type serverType,
    Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri) +215
    System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type
    serverType) +181
    System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type
    serverType, Object[] props, Boolean bNewObj) +74
    EntSrvcTest1_direct.WebForm1.Button1_Click(Object sender, EventArgs e) in
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
    eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1292


    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET

    z Guest

  3. #3

    Default RE: Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.G

    The problem deals with the fact that ASP.NET uses the anon user by default,
    who does not have access to your registry (for good reason). This means you
    either have to have the user log on (and have an account with registry
    access) or you have to get around it.

    To get around, the easiest way is to set up the registry access assembly in
    COM+. The ASP.NET app can hit the registry access objects, which can run
    under any account you set them up under. The downsides to this approach are
    the addition of both COM+ and some interop as well as the added need to keep
    called .NET components signed and in the GAC. If the registry access is
    separate and down the chain, this is a minor issue.

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Think Outside the Box!

    "z f" wrote:
    Cowboy Guest

  4. #4

    Default RE: Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.G

    Hello Cowboy (Gregory A. Beamer) - MVP,

    if auto registration happens in ASP.NET not the anon but the workerp process
    account is used. But still this account is not privilege enough to do the
    registration. I don't see ANY point in doing auto reg in web applications.

    just run regsvcs at install time and party on.

    Dominick Baier - DevelopMentor

    Dominick Guest

Similar Threads

  1. Web Service + Anon Access, but getting 401 Access Denied Error
    By Alex Washtell via .NET 247 in forum ASP.NET Web Services
    Replies: 1
    Last Post: April 5th, 04:57 PM
  2. ASP.NET and COM registry access denied
    By Bill in forum ASP.NET Security
    Replies: 3
    Last Post: July 15th, 12:38 AM
  3. Access denied when creating Access application object
    By Bill Murphy in forum ASP Database
    Replies: 7
    Last Post: July 31st, 05:37 PM
  4. access to system registry denied
    By Andrea Mondello in forum ASP.NET General
    Replies: 1
    Last Post: July 1st, 03:03 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139