Reputation: 2582
I've trying to write a extendable metro app using MEF. I got it working with a local extension (inside of the current assembly). Now I want to load a external dll. The DirectoryCatalog
seems to be not present in .net 4.5. So I tried to use ApplicationCatalog
but I got the following error while calling SatisfyImportsOnce
: Assembly.LoadFrom is not supported in AppX.
.
Here's me code:
var catalog = new AssemblyCatalog(GetType().GetTypeInfo().Assembly);
ApplicationCatalog catApp = new ApplicationCatalog();
AggregateCatalog cat = new AggregateCatalog(catalog, catApp);
_compositionService = cat.CreateCompositionService();
_compositionService.SatisfyImportsOnce(this);
Any suggestions what's going wrong?
I've placed the dll in the Appx directory and run VS11 Beta as administrator.
Upvotes: 1
Views: 1274
Reputation: 2582
I talked to some supporter in the MEF forums and he confirms that ApplicationCatalog could not be used out of a metro app. So this question is not solveable but could be closed. Source Thread
Upvotes: 1
Reputation: 976
Your external library reaches outside the allowed sandbox of Metro. The .NET framework in in the Metro environment is limited, similar to the WP7 or Micro Framework. There are a lot of things cut. If your external DLL isn't built using those constrained libraries, then the compiler will disallow its use.
Upvotes: 1