volkovku / RazorTemplates

Open source templating engine based on Microsoft's Razor parsing engine. Thread safe. Allows run Razor templates outside ASP.Net MVC Projects.
Microsoft Public License
99 stars 32 forks source link

Generating template gives System.Attribute defined in an assembly that is not referenced... #21

Closed jonbarkerlondon closed 5 years ago

jonbarkerlondon commented 5 years ago

I've attempted to add the reference to system.runtime but it doesn't make any difference.

An errors was occured on template compilation:

error CS0012: The type 'System.Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Any idea why this would occurr? It's a pretty simple razor template, with some simple objects. No attributes on any of the objects.

jonbarkerlondon commented 5 years ago

For anyone else having this problem - I switched to RazorEngine in the end, and used this solution.

https://github.com/Antaris/RazorEngine/issues/416

Prehaps what they did there is possible for RazorTemplates too? If so maybe someone could post a code sample to explain how.