Click here to Skip to main content
12,545,720 members (38,518 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# NHibernate
I have an ORM using NHibernate, in the method Select_Players() it throws an error, that cannot find some configuration files or what:
Could not load file or assembly 'Iesi.Collections, Version=, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.

Error at:
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();

public List<Player> Get_Player_Ranking_Men()
            // ---------------------------------------------------------------------------------

            // setup nhibernate configuration
            NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
            config.SetProperty(NHibernate.Cfg.Environment.Dialect, "NHibernate.Dialect.MsSql2008Dialect");
            config.SetProperty(NHibernate.Cfg.Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider");
            config.SetProperty(NHibernate.Cfg.Environment.ConnectionString, "Data Source=PETA3NEC_NTBK;Initial Catalog=Beach_Volleyball;Integrated Security=True");
            // add our assembly
            // setup nhibernate session
            NHibernate.ISessionFactory factory = config.BuildSessionFactory();
            NHibernate.ISession session = factory.OpenSession();
            // start nhibernate transaction
            NHibernate.ITransaction transaction = session.BeginTransaction();
            // ---------------------------------------------------------------------------------

            IQuery query = session.CreateQuery("SELECT [Nickname], [Prijmeni], [Jmeno], [Pohlavi], [Play_by_Play_Name], [Role], [Datum_Registrace], [Tour_Points], [Email] FROM [Player] WHERE (([Pohlavi] = 'Muž') AND ([Aktivita] = 1)) ORDER BY [Tour_Points] DESC");
            List<Player> ListPlayer = query.List<Player>().ToList();
            return ListPlayer;

and XML file for class Player (Player.hbm.xml):
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  <class name="Player" table="Player">
    <id name="Nickname" column="Nickname" type="String">
    <property name="Jmeno"  column="Jmeno" type="String"/>
    <property name="Prijmeni"  column="Prijmeni" type="String"/>
    <property name="Pohlavi"  column="Pohlavi" type="String"/>
    <property name="Play_by_Play_Name"  column="Play_by_Play_Name" type="String"/>
    <property name="Role"  column="Role" type="String"/>
    <property name="Datum_Registrace"  column="Datum_Registrace" type="DateTime"/>
    <property name="Tour_Points"  column="Tour_Points" type="Int32"/>
    <property name="Email"  column="Email" type="String"/>
    <property name="Foto"  column="Foto" type="Image"/>
    <property name="Aktivita"  column="Aktivita" type="Int32"/>

Can anyone solve this error?


-Pepin z Hane
Posted 13-Nov-12 5:00am
Updated 13-Nov-12 5:01am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need a reference to Iesi.Collections[^]

It wants version 1.0.1, which you can get here[^]

Use package manager to install the reference.
Pepin z Hane 13-Nov-12 13:18pm
Thanks, now it throws different errors about table mapping documents :-D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.161018.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100