2009-09-24 9 views
0

Est-ce que quelqu'un a une quelconque expérience de l'erreur de configuration fluide suivante?Erreur lors de la création de la session Fluent NHibernate Session

faultString = « Une configuration incorrecte ou incomplète a été utilisée lors de la création d'une SessionFactory. Vérifiez collection PotentialReasons et InnerException pour plus de détails.

Je n'ai aucun problème sur ma boîte de développement, mais quand les dll sont mis en place sur le serveur de production et testé, l'erreur se produit.

la boîte de développement pointe à la même base de données, donc je ne pense pas que les différences de schéma sont la question.

De plus, quelqu'un sait-il s'il existe une documentation sur la narguilé fluide?

Des pointeurs très appréciés.

Voici l'exception interne générée:

System.TypeInitializationException: The type initializer for 'NHibernate.ByteCode.Castle.ProxyFactory' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers. 

    at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly, String strongAssemblyName, String strongModulePath, String weakAssemblyName, String weakModulePath) 

    at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly) 

    at Castle.DynamicProxy.ProxyGenerator..ctor() 

    at NHibernate.ByteCode.Castle.ProxyFactory..cctor() 

The action that failed was: 

LinkDemand 

The Zone of the assembly that failed was: 

MyComputer 

    --- End of inner exception stack trace --- 

    at NHibernate.ByteCode.Castle.ProxyFactory..ctor() 

    at NHibernate.ByteCode.Castle.ProxyFactoryFactory.BuildProxyFactory() 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildProxyFactoryInternal(PersistentClass class, IGetter getter, ISetter setter) 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildProxyFactory(PersistentClass persistentClass, IGetter idGetter, ISetter idSetter) 

    at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) 

    at NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass mappedEntity, EntityMetamodel em) 

    at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory) 

    at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) 

    at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) 

    at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) 

    at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) 

    at NHibernate.Cfg.Configuration.BuildSessionFactory() 

    at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 93" 
    message = "faultCode:Server.Processing faultString:'System.TypeInitializationException: The type initializer for 'NHibernate.ByteCode.Castle.ProxyFactory' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers. 

    at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly, String strongAssemblyName, String strongModulePath, String weakAssemblyName, String weakModulePath) 

    at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly) 

    at Castle.DynamicProxy.ProxyGenerator..ctor() 

    at NHibernate.ByteCode.Castle.ProxyFactory..cctor() 

The action that failed was: 

LinkDemand 

The Zone of the assembly that failed was: 

MyComputer 

    --- End of inner exception stack trace --- 

    at NHibernate.ByteCode.Castle.ProxyFactory..ctor() 

    at NHibernate.ByteCode.Castle.ProxyFactoryFactory.BuildProxyFactory() 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildProxyFactoryInternal(PersistentClass class, IGetter getter, ISetter setter) 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildProxyFactory(PersistentClass persistentClass, IGetter idGetter, ISetter idSetter) 

    at NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappingInfo) 

    at NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) 

    at NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass mappedEntity, EntityMetamodel em) 

    at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory) 

    at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) 

    at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) 

    at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) 

    at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners) 

    at NHibernate.Cfg.Configuration.BuildSessionFactory() 

    at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 93' faultDetail:'null'" 
    name = "Error" 
    rootCause = (null) 

FluorineStackTrace: 

undefined 
+1

Fluent NHibernate docs: http://wiki.fluentnhibernate.org/Main_Page –

+0

Merci pour votre aide, je l'ai traçai l'exception interne et l'a ajouté à la publication originale. Je ne sais pas quoi faire ensuite. – Chin

Répondre

2

Je pense que cela est proche de cette question sur la confiance:

NHibernate 2 + Fluent Nhibernate medium trust

La question est pas couramment NHibernate, mais Castle Dynamic Proxy 2. J'ai personnellement une confiance totale sur l'environnement que je déploie à donc je n'ai pas eu à le résoudre.

Vos options sont:

  • Obtenir un château mis à jour Dynamic Proxy pour que ce soit fixe.
  • Essayez un autre proxy.
  • Utilisez l'usine de proxy nhibernate prégénérée.

Vous devriez être en mesure de trouver des postes pour tous ceux-ci sur nhforge.org

0

Voir la réponse à cette question:

assembly does not allow partially trusted callers

Votre machine de développement est en cours d'exécution probable confiance totale, alors que votre machine de production est probablement en marche confiance moyenne.