title: Why is this parameter not CLS-compliant?
body: <p>I am trying to eliminate all the CLS-compliant errors that we have throughout out solution. While I have managed to sort out several (e.g. public variables beginning with an underscore and using unsigned integers), there are a few which I can't seem to find the reason why they are failing.</p>
  
  <p>I have pasted the all the code relevant to one of the problems, there is a fair amount of code, but it only consists of a form constructor, interface and class that implements the interface.</p>
  
  <p>VB.Net form constructor (the warning is on the <code>unitOfWork</code> parameter and reads <em>Type of parameter 'unitOfWork' is not CLS-compliant</em>:</p>
  
  <pre><code>Public Sub New(ByRef unitOfWork As IUnitOfWork)
  
      MyBase.New()
      InitializeComponent()
  
      _unitOfWork = unitOfWork
  
  End Sub
  </code></pre>
  
  <p>The interface <code>IUnitOfWork</code> is as follows:</p>
  
  <pre><code>public interface IUnitOfWork : IDisposable
  {
      bool IsInTransaction { get; }
  
      bool IsDirty { get; }
  
      object BeginTransaction();
  
      object BeginTransaction(IsolationLevel isolationLevel);
  
      void Commit();
  
      void Rollback();
  
      object Session { get; }
  }
  </code></pre>
  
  <p>And the one and only implementation of the interface (and therefore the an instance of which will be passed to the form constructor) is this:</p>
  
  <pre><code>public class UnitOfWork : IUnitOfWork
  {
      private ISession _session;
  
      public UnitOfWork(SMSession session)
      {
          if (session == null)
          {
              throw new ArgumentNullException("Session wasn't supplied");
          }
  
          this._session = (ISession)session.OpenSession();
      }
  
      public bool IsInTransaction
      {
          get { return this._session.Transaction.IsActive; }
      }
  
      public bool IsDirty
      {
          get { return this._session.IsDirty(); }
      }
  
      public object Session
      {
          get { return this._session; }
      }
  
      public object BeginTransaction() 
      {
          return this._session.BeginTransaction(IsolationLevel.ReadCommitted);
      }
  
      public object BeginTransaction(IsolationLevel isolationLevel) 
      {
          return this._session.BeginTransaction(isolationLevel);
      }
  
      public void Commit()
      {
          if (this._session.Transaction == null)
          {
              throw new NullReferenceException
                  ("The Transaction has not been initialised");
          }
  
          this._session.Transaction.Commit();
      }
  
      public void Rollback()
      {
          if (this._session.Transaction == null)
          {
              throw new NullReferenceException
                  ("The Transaction has not been initialised");
          }
  
          this._session.Transaction.Rollback();
      }
  
      private bool disposed = false;
  
      protected virtual void Dispose(bool disposing)
      {
          if (!this.disposed)
          {
              if (disposing)
              {
                  this._session.Dispose();
              }
          }
          this.disposed = true;
      }
  
      public void Dispose()
      {
          if (this._session != null)
          {
              this._session.Dispose();
          }
  
          Dispose(true);
          GC.SuppressFinalize(this);
      }
  }
  </code></pre>
  
  <p>I am either being blind to the issue (could be the case as I have been staring at this for ages!) or there is another CLS-compliance restriction that I am unaware of. Any suggestions?</p>