Click here to Skip to main content
15,877,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
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=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.

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


Codes:
C#
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
            config.AddAssembly("Entities");

            // 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
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   namespace="Entities"
                   assembly="Entities">

  <class name="Player" table="Player">
    <id name="Nickname" column="Nickname" type="String">
    </id>

    <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"/>
  </class>
</hibernate-mapping>


Can anyone solve this error?

Thanks!

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

1 solution

You need a reference to Iesi.Collections

https://nuget.org/packages/Iesi.Collections[^]

It wants version 1.0.1, which you can get here

https://nuget.org/packages/Iesi.Collections/1.0.1[^]

Use package manager to install the reference.
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900