Compiling Prism App

Topics: Prism v2 - WPF 3.5, Prism v2 - WPF 4, Prism v4 - WPF 4
Aug 13, 2010 at 12:24 PM
I have structured my Prism app per one of the examples. I have the Main app and a series of modules (class libraries). I have a post Build event to copy the modules to a modules directory in the main app. When the build is finished, I have the referenced Prism assemblies in both the Modules folder and the main app folder. How to I create a single folder (like a bin folder) for all the external Prism assemblies regardless of which moduels or the main app reference them? Thanks
Aug 13, 2010 at 6:30 PM


I do not know your exact scenario, but at run time, a referenced assembly must exist in either the global cache assembly (GAC) or the output path of the project. That means that the Prism assemblies must be copied to the output folder (as they are not installed in the GAC) of the main project. The rest of the projects (e.g. modules) could make of use one of the following three options to avoid duplicating assemblies:

  1. Set the CopyLocal property of their Prism references to false, since they are loaded by the main project and it contains the Prism assemblies in its output folder. For more information about this, you could take a look at CopyLocal Property (Reference Object) on MSDN.
  2. Filter those Prism assemblies in the post build event to avoid copying them.
  3. Use the same output folder for all the projects that compose in your application by configuring it from their project properties page in the Build tab.

Please let me know if this helps.

Fernando Antivero