NServiceBus.NHibernate Exception

When starting an endpoint I am getting the following exception.

System.Exception: ‘Failed to add index! Are your sagas sharing types?’
Inner Exception
MappingException: Index IDX_84E615BA already exists!

As far as I can tell there are no shared saga types in the two sagas in this endpoint or any of the other endpoints. Also, when I run the endpoint with the following

endpointConfiguration.Sagas().DisableBestPracticeValidation();

The same exception is thrown.

Any ideas on how to find out what is causing the issue? I cannot find an index with that name in the database already.

EDIT -

Looking further I have discovered if I remove the following the exception goes away

 private IList<WCTPResponsePair> responsePairs;
 public virtual IList<WCTPResponsePair> ResponsePairs
 {
     get
     {
         if (responsePairs == null)
         {
             responsePairs = new List<WCTPResponsePair>();
         }
         return responsePairs;
     }
     set
     {
         responsePairs = value;
     }
 }

and a response pair is the following.

public class WCTPResponsePair
{
    public virtual Guid Id { get; set; }
    public virtual string ResponseValue { get; set; }
    public virtual string ResponseKey { get; set; }
}

This setup worked in NServiceBus 3 and an older version of NServiceBus.NHibernate. Any ideas why it is throwing an exception?

Hi Jordan,

The following should work:

public virtual IList<WCTPResponsePair> ResponsePairs { get; set; } = new List<WCTPResponsePair>();

The latest versions of NHibernate may no longer support that way of defining properties.

Regards
John

Thank you John. That was the issue.