mercredi 2 septembre 2015

PRISM/MEF and DEP not working

I'm currently developing an Application with PRISM and MEF. This Application will only run on some computers. On some others appears the following message:

A Problem has has stopped the correct execution of this program. Please close the Application.

(Freely translated from German, excuse me).

I figured out, that this issue is created by the following Code snippet:

var assembly = Assembly.LoadFrom(fileName);

or also from

var catalog = new DirectoryCatalog(Path.GetDirectoryName(fileName), Path.GetFileName(fileName));

Both solutions to load assembly by assembly don't work. How can I make it DEP-compatible?.

Thanks for your answers :)

// Edit: The Reason why I Load assembly by Assembly is, that I wan't to prevent loading assemblies twice to prevent Exceptions while Resolving classes (for example the ServiceLocator from PRISM).





Aucun commentaire:

Enregistrer un commentaire