Is there a way to elevate the users privileges? or the environments
privileges?

On Jan 7, 5:00 pm, Greg Young <[email protected]> wrote:
> because its building the proxy that needs the elevated privs? after
> its built you wouldnt need the privs just to access the existing built
> type.
>
> On Fri, Jan 7, 2011 at 4:54 PM, Jason Meckley <[email protected]> wrote:
> > another observation.
>
> > If I access a webpage that uses lazy loading everything works for me.
> > The non-admin user could then access that same page and it works for
> > him/her.
> > If a non-admin accesses a webpage that users lazy loading the page
> > won't load (errors). If I then access the page it works and it will
> > start working for the non-admin until the application stops.
>
> > If figure this has to do with NH being "lazy" about things and doesn't
> > spin up dynamic proxies until they are actually needed. But why would
> > it work for non-admins after I access the proxy?
>
> > On Jan 7, 4:45 pm, Jason Meckley <[email protected]> wrote:
> >> I thought the castle proxy issue was fixed with NH3?
>
> >> We are running into this issue in our test environment.
> >> NH 3
> >> Castle core, monorail, windsor 2.5
> >> automapper
> >> my project targets .net 4.0
>
> >> With 2.1 I used LinFu for proxies because Castle was throwing this
> >> error. With 3.0 I replaced LinFu with Castle to reduce the number of
> >> dependencies.
>
> >> The system runs fine locally and I can access the test environment and
> >> not get this error. However my non-admin users are getting a blank
> >> page, or no feedback from an ajax call, when a proxy call is
> >> attempted.
>
> >> The servers are on my companies intranet. AFAIK we are using the
> >> default trust settings. Nobody has adjusted them. I am using NH 3.0
> >> and castle proxies on a webforms project to use lazy properties and
> >> that system is running without errors.
>
> >> How can I confirm the trust settings are set to FULL on the web
> >> server?
>
> >> As a last resort I could switch back to LinFu, but I would prefer to
> >> use a single proxy library if possible.
>
> >> here is the stack trace
>
> >> 2011-01-07 16:17:27,436 [9] ERROR
> >> NHibernate.ByteCode.Castle.ProxyFactory [(null)] - Creating a proxy
> >> instance failed
>
> >> System.ArgumentException: Unable to obtain public key for
> >> StrongNameKeyPair.
> >>    at System.Reflection.StrongNameKeyPair.ComputePublicKey()
> >>    at System.Reflection.StrongNameKeyPair.get_PublicKey()
> >>    at System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain,
> >> AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence
> >> evidence, PermissionSet requiredPermissions, PermissionSet
> >> optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark&
> >> stackMark, IEnumerable`1 unsafeAssemblyAttributes,
> >> SecurityContextSource securityContextSource)
> >>    at
> >> System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName
> >> name, AssemblyBuilderAccess access, String dir, Evidence evidence,
> >> PermissionSet requiredPermissions, PermissionSet optionalPermissions,
> >> PermissionSet refusedPermissions, StackCrawlMark& stackMark,
> >> IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource
> >> securityContextSource)
> >>    at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName
> >> name, AssemblyBuilderAccess access, String dir, Evidence evidence,
> >> PermissionSet requiredPermissions, PermissionSet optionalPermissions,
> >> PermissionSet refusedPermissions, StackCrawlMark& stackMark,
> >> IEnumerable`1 assemblyAttributes, SecurityContextSource
> >> securityContextSource)
> >>    at System.AppDomain.DefineDynamicAssembly(AssemblyName name,
> >> AssemblyBuilderAccess access)
> >>    at Castle.DynamicProxy.ModuleScope.CreateModule(Boolean
> >> signStrongName)
> >>    at
> >> Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithStrongName()
> >>    at Castle.DynamicProxy.ModuleScope.DefineType(Boolean
> >> inSignedModulePreferably, String name, TypeAttributes flags)
> >>    at
> >> Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope
> >> modulescope, String name, Type baseType, IEnumerable`1 interfaces,
> >> TypeAttributes flags, Boolean forceUnsigned)
> >>    at
> >> Castle.DynamicProxy.Generators.InvocationTypeGenerator.GetEmitter(ClassEmitter
> >> class, Type[] interfaces, INamingScope namingScope, MethodInfo
> >> methodInfo)
> >>    at
> >> Castle.DynamicProxy.Generators.InvocationTypeGenerator.Generate(ClassEmitter
> >> class, ProxyGenerationOptions options, INamingScope namingScope)
> >>    at
> >> Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.BuildInvocationType(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options)
> >>    at
> >> Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.GetMethodGenerator(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options,
> >> OverrideMethodDelegate overrideMethod)
> >>    at
> >> Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementMethod(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options,
> >> OverrideMethodDelegate overrideMethod)
> >>    at
> >> Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter
> >> class, ProxyGenerationOptions options)
> >>    at
> >> Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String
> >> name, Type[] interfaces, INamingScope namingScope)
> >>    at
> >> Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1.<GenerateCode>b__0(String
> >> n, INamingScope s)
> >>    at
> >> Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey
> >> cacheKey, Func`3 factory)
> >>    at
> >> Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[]
> >> interfaces, ProxyGenerationOptions options)
> >>    at
> >> Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type
> >> classToProxy, Type[] additionalInterfacesToProxy,
> >> ProxyGenerationOptions options)
> >>    at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type
> >> classToProxy, Type[] additionalInterfacesToProxy,
> >> ProxyGenerationOptions options, Object[] constructorArguments,
> >> IInterceptor[] interceptors)
> >>    at NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(Object id,
> >> ISessionImplementor session)
>
> >> 2011-01-07 16:17:27,529 [9] ERROR
> >> MacolaDbaseConnector.Web.Controllers.GeneralRescueController [(null)]
> >> - Trying to map
> >> System.Collections.Generic.IEnumerable`1[[MacolaDbaseConnector.Domain.Location,
> >> MacolaDbaseConnector.Domain, Version=1.0.0.0, Culture=neutral,
> >> PublicKeyToken=null]] to
> >> MacolaDbaseConnector.Web.Model.LocationLookup[].
> >> Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.
>
> >> AutoMapper.AutoMapperMappingException: Trying to map
> >> System.Collections.Generic.IEnumerable`1[[MacolaDbaseConnector.Domain.Location,
> >> MacolaDbaseConnector.Domain, Version=1.0.0.0, Culture=neutral,
> >> PublicKeyToken=null]] to
> >> MacolaDbaseConnector.Web.Model.LocationLookup[].
> >> Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.
> >> ---> NHibernate.HibernateException: Creating a proxy instance failed
> >> ---> System.ArgumentException: Unable to obtain public key for
> >> StrongNameKeyPair.
> >>    at System.Reflection.StrongNameKeyPair.ComputePublicKey()
> >>    at System.Reflection.StrongNameKeyPair.get_PublicKey()
> >>    at System.Reflection.Emit.AssemblyBuilder..ctor(AppDomain domain,
> >> AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence
> >> evidence, PermissionSet requiredPermissions, PermissionSet
> >> optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark&
> >> stackMark, IEnumerable`1 unsafeAssemblyAttributes,
> >> SecurityContextSource securityContextSource)
> >>    at
> >> System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(AssemblyName
> >> name, AssemblyBuilderAccess access, String dir, Evidence evidence,
> >> PermissionSet requiredPermissions, PermissionSet optionalPermissions,
> >> PermissionSet refusedPermissions, StackCrawlMark& stackMark,
> >> IEnumerable`1 unsafeAssemblyAttributes, SecurityContextSource
> >> securityContextSource)
> >>    at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName
> >> name, AssemblyBuilderAccess access, String dir, Evidence evidence,
> >> PermissionSet requiredPermissions, PermissionSet optionalPermissions,
> >> PermissionSet refusedPermissions, StackCrawlMark& stackMark,
> >> IEnumerable`1 assemblyAttributes, SecurityContextSource
> >> securityContextSource)
> >>    at System.AppDomain.DefineDynamicAssembly(AssemblyName name,
> >> AssemblyBuilderAccess access)
> >>    at Castle.DynamicProxy.ModuleScope.CreateModule(Boolean
> >> signStrongName)
> >>    at
> >> Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithStrongName()
> >>    at Castle.DynamicProxy.ModuleScope.DefineType(Boolean
> >> inSignedModulePreferably, String name, TypeAttributes flags)
> >>    at
> >> Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope
> >> modulescope, String name, Type baseType, IEnumerable`1 interfaces,
> >> TypeAttributes flags, Boolean forceUnsigned)
> >>    at
> >> Castle.DynamicProxy.Generators.InvocationTypeGenerator.GetEmitter(ClassEmitter
> >> class, Type[] interfaces, INamingScope namingScope, MethodInfo
> >> methodInfo)
> >>    at
> >> Castle.DynamicProxy.Generators.InvocationTypeGenerator.Generate(ClassEmitter
> >> class, ProxyGenerationOptions options, INamingScope namingScope)
> >>    at
> >> Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.BuildInvocationType(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options)
> >>    at
> >> Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.GetMethodGenerator(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options,
> >> OverrideMethodDelegate overrideMethod)
> >>    at
> >> Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementMethod(MetaMethod
> >> method, ClassEmitter class, ProxyGenerationOptions options,
> >> OverrideMethodDelegate overrideMethod)
> >>    at
> >> Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter
> >> class, ProxyGenerationOptions options)
> >>    at
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to