JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
572 stars 119 forks source link

Compilation error when using the RazorEngine package #54

Closed danspam closed 6 years ago

danspam commented 6 years ago

I am using RazorEngine https://github.com/Antaris/RazorEngine and if I try to use lamar with this then you get a compilation error when the asp.net site starts (CS0118: 'RazorEngine' is a namespace but is used like a type).

I guess the issue is related to #51 in the fact that the lack of explicit namespaces in the generated code is causing conflicts.

A failing unit test is here: https://github.com/danspam/lamar/tree/razorengine-issue

I will try to see if I can figure out a fix for this and add a PR, although if this is the same type of issue as #51 then perhaps a more extensive fix in the code generation is needed that will cover other similar cases?

danspam commented 6 years ago

Well, it looks like PR #52 will fix my failing test too. I guess I should have checked that first...

jeremydmiller commented 6 years ago

@danspam Can you try Lamar 1.0.3 and see if it addressed this issue?

danspam commented 6 years ago

Yes, that has fixed the issue. Thanks. 👍