Compiling under .NET 4.0

Alex's Avatar

Alex

27 Aug, 2010 10:05 PM via web

Hi,

I am a .NET newbie so I hope this question is not overly dumb. I am starting a project for which I would like to use Fluent, the project is to be compiled under .NET 4.0. After getting the code from git I was able to compile and run the examples, however I've noticed that target framework is set to 3.5. After changing the framework to 4.0 in all project I got a number of these errors:

error CS0104: 'ISet' is an ambiguous reference between 'System.Collections.Generic.ISet' and 'Iesi.Collections.Generic.ISet'

I was able to fix all of them and get the solution to compile by replacing ISet with Iesi.Collections.Generic.ISet everywhere where the error occurred.

The tests would not run however, they will always fail with the following exception

{"An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.\r\n\r\n"} System.Exception {FluentNHibernate.Cfg.FluentConfigurationException}

stack trace

FluentNHibernate.dll!FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() Line 98 + 0x16 bytes
Examples.FirstProject.exe!Examples.FirstProject.Program.CreateSessionFactory() Line 81 + 0xc9 bytes
Examples.FirstProject.exe!Examples.FirstProject.Program.Main() Line 19 + 0x5 bytes

The same happens if you compile Fluent under 3.5 but FirstProject under 4.0.

I am probably doing something obviously wrong. Any help would be greatly appreciated.

Thank you

  1. Support Staff 2 Posted by James Gregory on 27 Aug, 2010 10:33 PM

    James Gregory's Avatar

    What does the InnerException say?

  2. 3 Posted by Alexander Kress on 28 Aug, 2010 01:48 AM

    Alexander Kress's Avatar

    Hi James,

    Thank you for the super quick reply.

    The inner exceptions says

    {"Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate,
    Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4."}
    System.Exception {NHibernate.HibernateException}

    The inner exception one level down contains

    {"The IDbCommand and IDbConnection implementation in the assembly
    System.Data.SQLite could not be found. Ensure that the assembly
    System.Data.SQLite is located in the application directory or in the Global
    Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in
    the application configuration file to specify the full name of the
    assembly."} System.Exception {NHibernate.HibernateException}

    From this it looks like the problem is with the SQLite driver. Do I need to
    compile the driver under .NET 4.0 for it to work?

    Thanks,

    Alex

    ----- Original Message ----
    From: James Gregory
    <***@tenderapp.com>
    To: "***@rogers.com" <***@rogers.com>
    Sent: Fri, August 27, 2010 6:36:01 PM
    Subject: Re: Compiling under .NET 4.0 [Help and guidance]

  3. 4 Posted by Alex on 28 Aug, 2010 01:59 AM

    Alex's Avatar

    Additional information. I've downloaded SQLite driver for .NET 4.0 from http://geeklyeverafter.blogspot.com/2010/03/sqlite-available-for-ne... but still getting the same error.

    Thanks for your help!

    Alex

  4. 5 Posted by Alex on 31 Aug, 2010 05:45 PM

    Alex's Avatar

    To close off this discussion. The problem was definitely with SQLite. After I've changed configuration to use SQL Server everything started to work as expected.

    Thank you!

  5. 6 Posted by Wil on 08 Sep, 2010 09:02 PM

    Wil's Avatar

    I switched the projects from 4.0 to 3.5 back to 4.0 and this fixed the problem

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is the opposite of north?