Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# NHibernate
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:
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
 
Codes:
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 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 13-Nov-12 6:00am
Edited 13-Nov-12 6:01am
v2

1 solution

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

Solution 1

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.
  Permalink  
Comments
Pepin z Hane at 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
0 DamithSL 325
1 OriginalGriff 199
2 BillWoodruff 170
3 Zoltán Zörgő 165
4 Maciej Los 123
0 OriginalGriff 7,854
1 DamithSL 5,949
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,084
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2014
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