3

I'm upgrading a Windows Smart Client solution from nHibernate 2.2 to 4.0. This required updating Iesi.Collections (4.0.1.4000) as well.

On this line:

protected Iesi.Collections.Generic.ISet<PermitEvent> eventSet;

I get this error:

The type or namespace name 'ISet' does not exist in the namespace 'Iesi.Collections.Generic' 

This question has gone unanswered at 2 other sites:
http://www.c-sharpcorner.com/forums/the-type-or-namespace-name-iset-could-not-be-found http://www.resolvinghere.com/cc/the-type-or-namespace-name-iset-could-not-be-found.shtml

What can I do?

Al Lelopath
  • 6,448
  • 13
  • 82
  • 139
  • [Does this help?](http://stackoverflow.com/q/23211641/2530848) – Sriram Sakthivel Mar 23 '16 at 19:24
  • In the past and because of these kinds of problems, I have used IEnumerable and IList instead of anything in Iesi.Collections. I know that involves code changes (potentially many code changes), but might that be an option here? – Aron Boyette Mar 23 '16 at 20:27

1 Answers1

4

With NHibernate 4, in most cases you do not need anymore to explicitly depend on Iesi.

You should instead migrate your entities code to use System.Collections.Generic.ISet<T>.

This is what I have done, even before encountering any issue with Iesi. If you want to keep on using Iesi, you may be able to do that by supplying your own NHibernate.Bytecode.ICollectionTypeFactory with the optional setting collectiontype.factory_class. But I do not think it is worth the trouble.

Release notes, section "** Known BREAKING CHANGES from NH3.3.3.GA to 4.0.0.GA":

Many uses of set types from Iesi.Collections have now been changed to use corresponding types from the BCL. The API for these types are slightly different.

Frédéric
  • 9,364
  • 3
  • 62
  • 112