Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:23:16+00:00 2026-05-26T18:23:16+00:00

I am using Fluent NHibernate 1.2, NH 3.1 with castle for proxy generation. I

  • 0

I am using Fluent NHibernate 1.2, NH 3.1 with castle for proxy generation. I am trying to run the application (A simple win-forms app) as a non-admin user and seeing the exception:
Unable to obtain public key for StrongNameKeyPair. Previously (I’m not sure what I did to get around that step), the exception was Creating a proxy instance failed.

Some blog posts from 2010 suggest that Castle’s dynamic proxy may have problems with medium trust scenarios, so I’ve tried my luck with sn -m n but that doesn’t seem to do much.

Is anyone familiar with this behaviour?

Thanks,
JK

Edit:
The application call that generates this exception is a simple LINQ over a NHibernate session.
Here’s the top of the stack trace (the whole thing is ~ 60 lines long):

    mscorlib.dll!System.Reflection.StrongNameKeyPair.ComputePublicKey() + 0xca bytes    
mscorlib.dll!System.Reflection.StrongNameKeyPair.PublicKey.get() + 0x15 bytes   
mscorlib.dll!System.Reflection.Emit.AssemblyBuilder.AssemblyBuilder(System.AppDomain domain = {System.AppDomain}, System.Reflection.AssemblyName name = {System.Reflection.AssemblyName}, System.Reflection.Emit.AssemblyBuilderAccess access = Run, string dir = null, System.Security.Policy.Evidence evidence = null, System.Security.PermissionSet requiredPermissions = null, System.Security.PermissionSet optionalPermissions = null, System.Security.PermissionSet refusedPermissions = null, ref System.Threading.StackCrawlMark stackMark = LookForMyCaller, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder> unsafeAssemblyAttributes = null, System.Security.SecurityContextSource securityContextSource = CurrentAssembly) + 0x4b8 bytes  
mscorlib.dll!System.Reflection.Emit.AssemblyBuilder.InternalDefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, string dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, ref System.Threading.StackCrawlMark stackMark, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder> unsafeAssemblyAttributes, System.Security.SecurityContextSource securityContextSource) + 0x7e bytes  
mscorlib.dll!System.AppDomain.InternalDefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, string dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, ref System.Threading.StackCrawlMark stackMark, System.Collections.Generic.IEnumerable<System.Reflection.Emit.CustomAttributeBuilder> assemblyAttributes, System.Security.SecurityContextSource securityContextSource) + 0x2c bytes  
mscorlib.dll!System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access) + 0x2b bytes  
Castle.Core.dll!Castle.DynamicProxy.ModuleScope.CreateModule(bool signStrongName = true) + 0x1fa bytes  
Castle.Core.dll!Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithStrongName() + 0x9d bytes    
Castle.Core.dll!Castle.DynamicProxy.ModuleScope.ObtainDynamicModule(bool isStrongNamed = true) + 0x2b bytes 
Castle.Core.dll!Castle.DynamicProxy.ModuleScope.DefineType(bool inSignedModulePreferably = true, string name = "Castle.Proxies.Invocations.Entity`1_Equals", System.Reflection.TypeAttributes flags = Public | Serializable) + 0x5a bytes   
Castle.Core.dll!Castle.DynamicProxy.Generators.Emitters.ClassEmitter.CreateTypeBuilder(Castle.DynamicProxy.ModuleScope modulescope = {Castle.DynamicProxy.ModuleScope}, string name = "Castle.Proxies.Invocations.Entity`1_Equals", System.Type baseType = {Name = "InheritanceInvocation" FullName = "Castle.DynamicProxy.InheritanceInvocation"}, System.Collections.Generic.IEnumerable<System.Type> interfaces = {System.Type[0]}, System.Reflection.TypeAttributes flags = Public | Serializable, bool forceUnsigned = false) + 0x68 bytes 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:23:16+00:00Added an answer on May 26, 2026 at 6:23 pm

    Pretty silly – after a bit of trial and error I found that the Guest account is the problem. Creating a new account, when that account is in the Users group worked. The Guest account is far more restrictive than other accounts, but I probably assumed it can do certain things which it can’t…

    I’ll leave it at that as I’m not expecting a “Guest user” for this application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get logging enabled on my application using Fluent NHibernate and log4net.
I've just started using Fluent NHibernate and have run into the following problem trying
I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that
I am trying to automap my domain model using fluent nhibernate. In this particular
I have a Sharp Architecture based app using Fluent NHibernate with Automapping. I have
I'm using fluent NHibernate. I have an app.config file with few specific keys (applicationSettings
I am considering using Fluent NHibernate for a new application with SQL Server 2008
I'm using (fluent) nhibernate and I've run into a little problem. My data model
Hi is there good tutorial about using Fluent Nhibernate in asp.net/winforms application ? I
I am using Fluent Nhibernate 1.0 with Sharp Architecture 1.0 Currently I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.