Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Can't import Generic Types After Update from MEF 1 under .NET 4 to latest in .NET 4.5

$
0
0
Hi,

I have a project that was on .NET 4.0 using a MEF pre-release from about 2 years ago and we're trying to update it to .NET 4.5. The pre-release we were on doesn't work with .net 4.5, so we're attempting to update MEF to the latest, however it's failing while loading a generic interface type, that used to work:

[Import]
    public IRepository<HealthCareDomain, LookupListCategory> Categories { get; set; }
Here's the class definition that it should be loading:

[Export( typeof( IRepository<,> ) )]
[PartMetadata( ExportScope.Key, TransactionScope.Id )]
[PartCreationPolicy( CreationPolicy.Shared )]
public class Repository<TDomain,TEntity> : IRepository<TDomain,TEntity>, IRepository
    where TEntity : class
{
...
}

How can I work around this?

Thanks!

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>