Search code examples
c#nhibernatesmartclientiesi-collections

The type or namespace name 'ISet' does not exist


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?


Solution

  • 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.