I have copilot and I would be more than happy to spend some time with
someone on my machine to see what could be wrong. Below is the application
simplified to just attempt to connect and open a session.

private static ISessionFactory _factory;

public static void Main(string[] args)
{
// Just connect to the database and open a connection.
withSession(session =>{
return;
});

       print("Press any key to exit...");
Console.ReadKey();
}

static void withSession(Action<ISession> databaseWork)
{
using(var session = OpenSession())
{
databaseWork(session);
}
}

static ISession OpenSession()
{
if (_factory == null) _factory = new Configuration().BuildSessionFactory();
return _factory.OpenSession();
}

static void print(string text, params object[] args)
{
Console.WriteLine(text, args);
}

web.config
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
 type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xlmns="urn:nhibernate-configuration-2.2">
<session-factory name="HelloNHibernate">
<property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.connection_string">Data Source=(local);
Database=HelloNHibernate; Integrated Security=SSPI;</property>
<property
name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle</property>
<property name="show_sql">false</property>
</session-factory>
</hibernate-configuration>
</configuration>

On Mon, Aug 31, 2009 at 2:33 PM, Brian Chiasson
<[email protected]>wrote:

> The only thing that I can think of, is that I am missing something in my
> configuration set up, so I have included that below.
> static ISession OpenSession()
> {
> if (_factory == null) _factory = new Configuration().BuildSessionFactory();
>  return _factory.OpenSession();
> }
>
> On Mon, Aug 31, 2009 at 12:11 PM, Brian Chiasson <
> [email protected]> wrote:
>
>> Fabio,
>>
>> I didn't even think to check the GAC. I outputted the list of DLLs to a
>> text file and did a search for Castle or NHibernate and it turned up nothing
>> (i used both v1.0 and v1.1 of the gacutil - there is none for later version
>> of the framework). It was a great thought!!
>>
>>
>> On Mon, Aug 31, 2009 at 12:01 PM, Fabio Maulo <[email protected]>wrote:
>>
>>> Ok.. all should work if you don't have some old dll in the GAC.
>>>
>>> 2009/8/31 Brian Chiasson <[email protected]>
>>>
>>>> In alphabetical order:
>>>> Antlr3.Runtime.dll
>>>> Castle.Core.dll
>>>> Castle.DynamicProxy2.dll
>>>> Iesi.Collections.dll
>>>> log4net.dll
>>>> NHibernate.ByteCode.Castle.dll
>>>> NHibernate.dll
>>>>
>>>> On Mon, Aug 31, 2009 at 11:53 AM, Fabio Maulo <[email protected]>wrote:
>>>>
>>>>> which is the list of dlls in your bin/debug ?
>>>>>
>>>>> 2009/8/31 Brian Chiasson <[email protected]>
>>>>>
>>>>> Cesar,
>>>>>> I have tried putting both Castle and LinFu as my proxyfactory, but
>>>>>> neither resolve the exception.
>>>>>>
>>>>>> I am stumped.
>>>>>>
>>>>>> On Mon, Aug 31, 2009 at 11:19 AM, Cesar Sanz <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>>  Generally, the nhibernate exceptions are very explicit...
>>>>>>>
>>>>>>>  Example:
>>>>>>> <property
>>>>>>> name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
>>>>>>> NHibernate.ByteCode.LinFu</property>
>>>>>>>
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>> *From:* Brian Chiasson <[email protected]>
>>>>>>> *To:* [email protected]
>>>>>>> *Sent:* Monday, August 31, 2009 8:57 AM
>>>>>>> *Subject:* [nhusers] Re: proxyfactory.factory_class not resolving
>>>>>>>
>>>>>>> I have included the message below, but it indicates that my
>>>>>>> configuration is wrong. This is a simple Console application created 
>>>>>>> from
>>>>>>> scratch.
>>>>>>>  NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The
>>>>>>> ProxyFactoryFactory was not configured.
>>>>>>> Initialize 'proxyfactory.factory_class' property of the
>>>>>>> session-factory configuration section with one of the available
>>>>>>> NHibernate.ByteCode providers.
>>>>>>> Example:
>>>>>>> <property
>>>>>>> name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory,
>>>>>>> NHibernate.ByteCode.LinFu</property>
>>>>>>> Example:
>>>>>>> <property
>>>>>>> name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory,
>>>>>>> NHibernate.ByteCode.Castle</property>
>>>>>>>    at
>>>>>>> NHibernate.Bytecode.AbstractBytecodeProvider.get_ProxyFactoryFactory()
>>>>>>>    at NHibernate.Cfg.Configuration.Validate()
>>>>>>>    at NHibernate.Cfg.Configuration.BuildSessionFactory()
>>>>>>>    at HelloNHibernate.Program.OpenSession() in
>>>>>>> C:\Development\NHibernate\in_action\HelloNHibernate\HelloNHibernate\Program.cs:line
>>>>>>> 78
>>>>>>>    at HelloNHibernate.Program.forTransaction(Action`1 databaseWork)
>>>>>>> in
>>>>>>> C:\Development\NHibernate\in_action\HelloNHibernate\HelloNHibernate\Program.cs:line
>>>>>>> 43
>>>>>>>    at HelloNHibernate.Program.CreateEmployeeAndSaveToDatabase() in
>>>>>>> C:\Development\NHibernate\in_action\HelloNHibernate\HelloNHibernate\Program.cs:line
>>>>>>> 70
>>>>>>>    at HelloNHibernate.Program.Main(String[] args) in
>>>>>>> C:\Development\NHibernate\in_action\HelloNHibernate\HelloNHibernate\Program.cs:line
>>>>>>> 17
>>>>>>>
>>>>>>> On Mon, Aug 31, 2009 at 10:51 AM, Fabio Maulo 
>>>>>>> <[email protected]>wrote:
>>>>>>>
>>>>>>>> which is the exception message and the message of the inner
>>>>>>>> exception ?
>>>>>>>>
>>>>>>>> 2009/8/31 Brian C <[email protected]>
>>>>>>>>
>>>>>>>>
>>>>>>>>> I am heading back to basics to get a better understanding of
>>>>>>>>> NHibernate and its architecture by following the NHibernate in
>>>>>>>>> Action
>>>>>>>>> book (which does not contain the latest configurations).
>>>>>>>>>
>>>>>>>>> In doing so, I have had to update myself (a good thing) on the
>>>>>>>>> latest
>>>>>>>>> differences for the configuration changes. I just cannot get passed
>>>>>>>>> this proxyfactory exception from NHibernate. I have read many posts
>>>>>>>>> online discussing what to do to get passed this error, but my code
>>>>>>>>> is
>>>>>>>>> not running. It's a simple console application and I am setting up
>>>>>>>>> the
>>>>>>>>> configuration in the app.config file (included below). The
>>>>>>>>> NHibernate.ByteCode.Castle DLL has been included as a reference and
>>>>>>>>> is
>>>>>>>>> being copied locally when VS compiles. I am not sure where to go
>>>>>>>>> from
>>>>>>>>> here.
>>>>>>>>>
>>>>>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>>>>>> <configuration>
>>>>>>>>>        <configSections>
>>>>>>>>>                <section name="hibernate-configuration"
>>>>>>>>>
>>>>>>>>> type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
>>>>>>>>>        </configSections>
>>>>>>>>>        <hibernate-configuration
>>>>>>>>> xlmns="urn:nhibernate-configuration-2.2">
>>>>>>>>>                <session-factory name="HelloNHibernate">
>>>>>>>>>                        <property
>>>>>>>>> name="dialect">NHibernate.Dialect.MsSql2005Dialect</
>>>>>>>>> property>
>>>>>>>>>                        <property
>>>>>>>>> name="connection.connection_string">Data Source=(local);
>>>>>>>>> Database=HelloNHibernate; Integrated Security=SSPI;</property>
>>>>>>>>>                        <property
>>>>>>>>>
>>>>>>>>> name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory,
>>>>>>>>> NHibernate.ByteCode.Castle</property>
>>>>>>>>>                        <property name="show_sql">false</property>
>>>>>>>>>                </session-factory>
>>>>>>>>>        </hibernate-configuration>
>>>>>>>>> </configuration>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Fabio Maulo
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Fabio Maulo
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Fabio Maulo
>>>
>>> >>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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