I develop Prism 6 WPF MVVM modular application. The solution of my application comprising one Shell project and many Prism module projects. In my application I have to realize Dynamic Source C# Code Generation and Compilation (CodeDom). I assume put code (building CodeDOM graph and compiling assembly from it) in some common class library (CL project) that is 'visible' from any Prism module project in my application solution so that I can call public methods for building CodeDOM graph and compiling assemblies from it from any Prism module in the application. But I don't know how to do assembly being compiled accessable from any Prism module in my application (i.e. every prism module must be able to call to assembly being compiled from CodeDOM graph). I assume that CodeDOM graph will be compiled to assembly as class library (with GenerateExecutable property set to false). I want that compiled assembly will be written to memory rather than disk (CompilerParameters.GenerateInMemory = true). What should I do if I want that assembly compiled from CodeDOM graph will be visible from all prism modules in my application and all these modules can call to the public methods and properties from the assemply? I use Dynamic Source C# Code Generation at first and I havn't used it before. So your help will be highly appreciated.
Asked
Active
Viewed 48 times
1 Answers
0
Prism Modules can depend on other modules.
Make the CodeDOM module a dependency of all the other modules and share a service interface/events to provide the functionality you need for the individual modules to access/call your runtime compiled assembly.

toadflakz
- 7,764
- 1
- 27
- 40
-
toadflakz, You have in mind that all modules in my application must have a reference to code compiled from CodeDOM graph? But this code will be written to memory but not in file! Is there a way to set in each prism module the reference to written to memory assembly compiled from CodeDOM graph? – Dr.Doog Mar 24 '16 at 16:53
-
You can dynamically load assemblies at runtime so part of the functionality of your CodeDOM module would handle communicating that to the other modules, if you need it to. – toadflakz Mar 24 '16 at 17:23