0

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).

// Edit 2: And I can't add the Application to the DEP exclusion list because not every customer has admin privileges.

CodeRain
  • 69
  • 11
  • Are you sure this has something to do with DEP? Have you tried to put a try-catch block around these code lines (to check whether and what exception is thrown)? – dymanoid Sep 08 '15 at 08:29
  • Hi thanks for your answer. I figured it now out. It was an combination of PRISM and Microsoft BCL (was requiered for using async in .net Framework 4.0 due to some Libraries). I could not debug anything, because on these clients where no Visual Studio installed.Also it hadn't start anyway. – CodeRain Sep 10 '15 at 05:15

0 Answers0