toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.5k stars 259 forks source link

Have more than one operatingAssembly ... or included assemblies #539

Open kevingy opened 7 months ago

kevingy commented 7 months ago

Is your feature request related to a problem? Please describe. Yes, I am creating an application (console app, assembly 1) that pulls data from another project (class library, assembly 2) then renders it using a project (class library, assembly 3) that wraps RazorLight. I'm doing this for loose coupling and separation of concerns. I want to be able to support several renderers - RazorLight being the first. All of the references are needed to have the assembly 2 data objects in the RazorLight wrapper (assembly 3) and it compiles fine, but throws an exception when I try to render. The current version allows SetOperatingAssembly(Assembly assembly), but I need to pull classes from more than one assembly. RazorLight is in the rendering library. The data to be rendered is in a different library. When I SetOperatingAssembly to the library with the data, I can't find RazorLight. When I SetOperatingAssembly to RazorLight, I can't find my data projecct classes.

Describe the solution you'd like Ideally, rather than SetOperatingAssembly(), it should be AddOperatingAssembly(), where each call adds an assembly up to N assemblies that can be used for class definitions.

jzabroski commented 6 months ago

Can you weave your classes into one master assembly.