Re: Registry Access Problem after Impersonation

From: Ramiro Calderon Romero (rcrdev@hotmail.com)
Date: 03/27/03


From: "Ramiro Calderon Romero" <rcrdev@hotmail.com>
Date: Wed, 26 Mar 2003 22:05:03 -0500


Hi,
According to the exception, it seems like the self-registration of a
Serviced Component doesn't work; maybe it's because a permissions issue.
Maybe you can register it first using the "regsvc" utility at deployment
time instead of relying in the self-registration feature of serviced
components at runtime.

Hope this helps,

--
Ramiro Calderon
MCAD MCSD
"Joel Orcutt" <jorcutt@steelpoint.com> wrote in message
news:a6bb8159.0303261055.327b00e1@posting.google.com...
> Hi -
>
> We're experiencing a very strange problem.  I setup an application to
> authenticate against active directory with forms based authentication
> and set <identity impersonate="true" /> in the webconfig.  I
> authenticate succesfully and the protected pages show that I'm
> impersonating the IUSR_machinename account.
>
> So far, so good.
>
> The problem is that I'm getting an access denied error several class
> layers deep in my object model.  I've pasted a copy of the error
> below.  This error only happens when I have the identity element in
> the web.config.  Note that I did change my machine.config to use the
> System account and I have granted the aspnet account "act as part of
> operating system" so that leads me to think that this is a privilege
> issue.
>
> Is there something special that I need to do to the IUSR_ account?  I
> have tried granting the "act as part of operating system" privilege
> and even went so far as to explicitly grant full control permissions
> on the HKEY_CLASSES_ROOT in the registry.
>
> One other oddity is that if I open VS.NET and run the web app without
> the identity element in the web.config everything is ok.  If I then
> add the identity element back into the web.config the app works !#@%.
> I can't really explain this other than thinking that the studio
> environment may be holding some security setting from the first run in
> between debug sessions.
>
> The error message is below.... Any help here is much appreciated.
>
> Joel Orcutt
>
>
> Exception:
>
> Failed to register assembly 'NewController, Version=1.0.1180.21617,
> Culture=neutral, PublicKeyToken=4bd480d6f8f2aa94'.
>
> at System.EnterpriseServices.RegistrationDriver.InstallAssembly(String
> assembly, String& application, String partition, String& tlb,
> InstallationFlags installFlags, Object obSync) at
> System.EnterpriseServices.RegistrationHelper.InstallAssembly(String
> assembly, String& application, String partition, String& tlb,
> InstallationFlags installFlags) at
> System.EnterpriseServices.RegistrationHelper.InstallAssembly(String
> assembly, String& application, String& tlb, InstallationFlags
> installFlags) at
System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.Thunk
.IThunkInstallation.DefaultInstall(String
> asm) at System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly
> assembly) at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type
> serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String&
> uri) at
System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Typ
e
> serverType) at
System.Runtime.Remoting.Activation.ActivationServices.CreateInstanceWithLink
Demand(ProxyAttribute
> pa, Type serverType) at
>
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Typ
e
> serverType, Object[] props) at
> TransactionController.Service1.execute() in
> C:\Clients\BridgeWorld\New\Web\NewController\Service1.cs:line 19 at
> TransactionController.SimpleFactory.executeCommandInstance(String
> p_type) in
C:\Clients\BridgeWorld\New\Web\NewController\SimpleFactory.cs:line
> 22 at TransactionController.Controller.simpleRequest(Boolean
> throwError) in
c:\clients\bridgeworld\new\web\newcontroller\controller.cs:line
> 86
>
> Inner Exception:
>
> Access to the registry key
> HKEY_CLASSES_ROOT\TransactionController.Global is denied.
>
> at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
> at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) at
>
System.Runtime.InteropServices.RegistrationServices.RegisterManagedType(Type
> type, String strAsmName, String strAsmCodeBase) at
>
System.Runtime.InteropServices.RegistrationServices.RegisterAssembly(Assembl
y
> assembly, AssemblyRegistrationFlags flags) at
> System.EnterpriseServices.RegistrationDriver.ClassicRegistration(Assembly
> asm)
>
> Original Exception:
>
> Access to the registry key
> HKEY_CLASSES_ROOT\TransactionController.Global is denied.
>
> at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
> at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) at
>
System.Runtime.InteropServices.RegistrationServices.RegisterManagedType(Type
> type, String strAsmName, String strAsmCodeBase) at
>
System.Runtime.InteropServices.RegistrationServices.RegisterAssembly(Assembl
y
> assembly, AssemblyRegistrationFlags flags) at
> System.EnterpriseServices.RegistrationDriver.ClassicRegistration(Assembly
> asm)
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003


Relevant Pages

  • RE: Access to the registry key HKEY_CLASSES_ROOTEntSrvcTest1_direct.G
    ... who does not have access to your registry. ... > type, String strAsmName, String strAsmVersion, String strAsmCodeBase, String ... > assembly, AssemblyRegistrationFlags flags) +258 ... > System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Registry Access Problem after Impersonation
    ... authenticate against active directory with forms based authentication ... assembly, String& application, String partition, String& tlb, ... InstallationFlags installFlags, Object obSync) at ... assembly, AssemblyRegistrationFlags flags) at ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Access to the registry key HKEY_CLASSES_ROOTEntSrvcTest1_direct.Global is denied
    ... using enterprise services from dot-net: ... Access to the registry key HKEY_CLASSES_ROOT\EntSrvcTest1_direct.Global is ... Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +74 ... assembly, AssemblyRegistrationFlags flags) +258 ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: Detailed ASP.Net info not displaying in browser
    ... HTTP 500 page when an exception is thrown from the web service. ... at VOSE.Data.DataRequest.dr_DB2Process.DeleteCommRows(String company, String ... objQueue, tOrderManagementIndicator omindicator, Int32 intTriggerId) in ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.xml)
  • RE: Detailed ASP.Net info not displaying in browser
    ... HTTP 500 page when an exception is thrown from the web service. ... at VOSE.Data.DataRequest.dr_DB2Process.DeleteCommRows(String company, String ... objQueue, tOrderManagementIndicator omindicator, Int32 intTriggerId) in ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.xml)