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

  • Home
  • SEARCH
  • 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 3309866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:41:30+00:00 2026-05-17T21:41:30+00:00

I’m using S#arp Architecture 1.6 and have implemented the Rhino Security integration as per

  • 0

I’m using S#arp Architecture 1.6 and have implemented the Rhino Security integration as per

Rhino Security – S#arp Architecture

I’m using the latest build from Rhino.Commons

My Application_EndRequest method contains

ISession session = NHibernateSession.Current;

My ComponentRegister.cs contains

        container.Kernel.Register(

            Component.For<IAuthorizationService>()
                .ImplementedBy<AuthorizationService>()
                .LifeStyle.Is(LifestyleType.Transient),
            Component.For<IAuthorizationRepository>()
                .ImplementedBy<AuthorizationRepository>()
                .LifeStyle.Is(LifestyleType.Transient),
            Component.For<IPermissionsBuilderService>()
                .ImplementedBy<PermissionsBuilderService>()
                .LifeStyle.Is(LifestyleType.Transient),
            Component.For<IPermissionsService>()
                .ImplementedBy<PermissionsService>()
                .LifeStyle.Is(LifestyleType.Transient),
            Component.For<IUnitOfWorkFactory>()
                .ImplementedBy<NHibernateUnitOfWorkFactory>()
                .LifeStyle.Is(LifestyleType.Singleton),
            Component.For<Rhino.Commons.IRepository<User>>()
                .ImplementedBy<NHRepository<User>>()
                .LifeStyle.Is(LifestyleType.Transient)
            );


        container.AddFacility<FactorySupportFacility>()
            .Register(Component.For<ISession>()
            .UsingFactoryMethod(() => NHibernateSession.Current)
            .LifeStyle.Is(LifestyleType.Transient)); 

I have also added RhinoSecurityPersistenceConfigurer() as per instructions.

The error I’m recieving on calling

UnitOfWork.Start() 

is

An association from the table Permissions refers to an unmapped class: Rhino.Security.IUser

Does anyone know what the cause of this error may be?

Has anyone successfully integrated Rhino.Security with S#arp Architecture?

Any help would be great.

Thanks

Rich

— Additional Details —

Thanks for all the replies so far.

I’ve still not been able to resolve this, so thought I’d add more details.

In my Global.asax.cs I have

private void InitializeNHibernateSession()
{
  NHibernateSession.Init(
    webSessionStorage,
    new string[] { Server.MapPath("~/bin/SwitchSnapshot.Data.dll") },
    new AutoPersistenceModelGenerator().Generate(),
    Server.MapPath("~/NHibernate.config"),
    null, null, new RhinoSecurityPersistenceConfigurer());
 }

RhinoSecurityPersistenceConfigurer :

public Configuration ConfigureProperties(Configuration nhibernateConfig)
{
  Security.Configure<User>(nhibernateConfig, SecurityTableStructure.Prefix);
  return nhibernateConfig;
}

I have an AuthorizationAttribute which calls

using (UnitOfWork.Start())

The error is occuring in NHibernateUnitOfWorkFactory.cs as

sessionFactory = cfg.BuildSessionFactory();
  • 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-17T21:41:31+00:00Added an answer on May 17, 2026 at 9:41 pm

    Thanks to all who helped out.

    In the end it was my own fault.

    All I needed to do was to follow the S#arp Architecture Instructions a little better.

    From an old version of S#arp I had 2 config files hibernate.cfg.xml and NHibernate.config. I thought I still needed both, but all I needed was hibernate.cfg.xml for S#arp version 1.6 and mapped User.cs using Fluent NHibernate.

    Other changes I did was in ComponentRegister.cs

            container.Kernel.Register( 
                Component.For<IAuthorizationService>()
                    .ImplementedBy<AuthorizationService>()
                    .LifeStyle.Is(LifestyleType.Transient),
                Component.For<IAuthorizationRepository>()
                    .ImplementedBy<AuthorizationRepository>()
                    .LifeStyle.Is(LifestyleType.Transient),
                Component.For<IPermissionsBuilderService>()
                    .ImplementedBy<PermissionsBuilderService>()
                    .LifeStyle.Is(LifestyleType.Transient),
                Component.For<IPermissionsService>()
                    .ImplementedBy<PermissionsService>()
                    .LifeStyle.Is(LifestyleType.Transient),
                Component.For<IUnitOfWorkFactory>()
                    .ImplementedBy<NHibernateUnitOfWorkFactory>()
                    .LifeStyle.Is(LifestyleType.Singleton),
                Component.For<Rhino.Commons.IRepository<User>>()
                    .ImplementedBy<NHRepository<User>>()
                    .LifeStyle.Is(LifestyleType.Transient)
            );
    
            container.Kernel.AddFacility<FactorySupportFacility>()
                .Register(Component.For<ISession>()
                .UsingFactoryMethod(() => NHibernateSession.Current)
                .LifeStyle.Is(LifestyleType.Transient)
            ); 
    

    Then use the following in my code.

            var authorizationService = IoC.Resolve<IAuthorizationService>();
    
            using (UnitOfWork.Start())
            {
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.