Closed mauroservienti closed 7 years ago
Razor internally manages the assembly adds - the code in the library doesn't actually track duplicates. In my tests adding the same assembly twice seems to work just fine.
This library just passes on the assemblies. I think the error might occur if you try to load the same assembly from different locations?
In some cases when hosting the RazorEngine in a Windows Service we get the following exception at template rendering time:
"An assembly with the same simple name '' has already been imported"
As far as I have understood is due to to the fact that not all the "AddAssembly" methods checks if assemblies are already in the ReferencedAssemblies collection.