title: Are we unable to use Interop objects in generic objects in .NET 4.0?
body: <p>I'm working in VS 2010 and working on upgrading our application to .NET 4.  The application is built with Excel as the base and we want to take advantage of some of the improvements to .NET for using Excel.  But I ran across a strange error that seems to be caused by using an Excel Interop object in a generic dictionary.  Here is the error that was generated:</p>
  
  <pre><code>C:\MyApp\TheAssembly\MyClass.cs(823,57): 
  error CS1769: Type 'MyApp\OtherAssemply.IMyController.SheetReports' from assembly 'c:\MyApp\OtherAssemply.\bin\Debug\OtherAssembly.dll' 
   cannot be used across assembly boundaries because it has a generic type 
   parameter that is an embedded interop type.
  </code></pre>
  
  <p>Here's the actual property that has the issue:</p>
  
  <pre><code>Dictionary&lt;Excel.Worksheet, IReportSheet&gt; SheetReports { get;}
  </code></pre>
  
  <p>Are we unable to use Interop objects in generic objects?  If so, this is a serious limitation in .NET 4.0.  I tried setting the Embed Interop property to false, but that didn't seem to change anything. Please let me know if there is any way around this.</p>