0
votes

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.

1

1 Answers

0
votes

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.