Git Product home page Git Product logo

essential-templating's People

Contributors

doyleam avatar smolyakoff avatar xcrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

essential-templating's Issues

The Essential.Templating.Common nuget package is outdated

The Essential.Templating.Common nuget package is outdated and conflicting with the latest Essential.Templating.Razor.Email

Exception Details: System.MissingMethodException: Method not found: '!!0 Essential.Templating.Razor.TemplateContext.AddOrGetExisting(System.String, System.Func`1<!!0>)'.

The old FileSystemResourceProvider doesn't throw an exception if the template is not found and returns null instead

LinkedResources from Layout aren't attached to the e-mail

Is the usage of Resources.Link supported from layout templates?

We're finding that if a resource is linked to the layout, the correct cid:XXX tag is inserted, but the linked resource itself isn't added to the e-mail. Doing the same from the main template works perfectly.

Thanks.

Essential.Templating.Common

I have tried to use this in my MVC project but the "Essential.Templating.Common.dll" is missing. I've installed it through nuget. I have download your test poject as well but this dll is missing

thanks

zak

Issue with Using Razor.Email.EmailTemplate

I get the following error when trying to use either a VB or C# template from within my VB.NET project.

Essential.Templating.Razor.Runtime.TypeMismatchException: Expected base template type: RazorEngine.Templating.ITemplate1[VB$AnonymousType_02[System.String,System.String]]. Actual base template type: Essential.Templating.Razor.Email.EmailTemplate

Failing Unit tests

Running on .NET 4.5.1 on Windows 8.1 x64.

All but one unit test fails in the Razor and Razor.Email projects.

All the failing tests fail like this:

Test method Essential.Templating.Razor.Email.Tests.EmailTemplateTest.RenderSimpleEmail threw exception:
Essential.Templating.Common.TemplateEngineException: Can't create instance of template [CompiledRazorTemplates.Dynamic.ebedacaeabcadb].
Base type: [Essential.Templating.Razor.Email.EmailTemplate]. ---> Essential.Templating.Razor.Runtime.ActivatorException: Can't create instance of template [CompiledRazorTemplates.Dynamic.ebedacaeabcadb].
Base type: [Essential.Templating.Razor.Email.EmailTemplate]. ---> System.ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000.
Parameter name: offset
at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset)
at System.DateTimeOffset..ctor(DateTime dateTime)
at System.DateTimeOffset.op_Implicit(DateTime dateTime)
at Essential.Templating.Razor.Runtime.ReflectionTemplateFactory.Create(Type templateType, TemplateContext templateContext) in ReflectionTemplateFactory.cs: line 30
at Essential.Templating.Razor.Runtime.TemplateActivator.Activate(Type templateType, TemplateContext context) in TemplateActivator.cs: line 26
--- End of inner exception stack trace ---
at Essential.Templating.Razor.Runtime.TemplateActivator.Activate(Type templateType, TemplateContext context) in TemplateActivator.cs: line 30
at Essential.Templating.Razor.RazorTemplateEngine.ActivateTemplate(Type templateType, TemplateContext context) in RazorTemplateEngine.cs: line 280
--- End of inner exception stack trace ---
at Essential.Templating.Razor.RazorTemplateEngine.ActivateTemplate(Type templateType, TemplateContext context) in RazorTemplateEngine.cs: line 284
at Essential.Templating.Razor.RazorTemplateEngine.ResolveTemplate(String path, CultureInfo culture) in RazorTemplateEngine.cs: line 157
at Essential.Templating.Razor.RazorTemplateEngine.Render(String path, IRenderer`2 renderer, Object viewBag, CultureInfo culture) in RazorTemplateEngine.cs: line 95
at Essential.Templating.Razor.Email.TemplateEngineExtensions.RenderEmail(ITemplateEngine templateEngine, String path, Object viewBag, CultureInfo culture) in TemplateEngineExtensions.cs: line 21
at Essential.Templating.Razor.Email.Tests.EmailTemplateTest.RenderSimpleEmail() in EmailTemplateTest.cs: line 30

Incompatible with RazorEngine 3.5.2

After updating RazorEngine from 3.4.1 to 3.5.2, Essential Templating throws an exception when trying to render an e-mail using

The top of the stack trace is:

System.MissingMethodException: Method not found: 'System.String RazorEngine.Templating.ITemplate.Run(RazorEngine.Templating.ExecuteContext)'.
at Essential.Templating.Razor.Email.TemplateEngineExtensions.RenderEmail(ITemplateEngine templateEngine, String path, Object viewBag, CultureInfo culture)

We've reverted RazorEngine back to 3.4.1 and the issue no longer exists.

Model is not sent to layout

Hello,
I was trying to use the model in the layout but I saw that it's not possible. Could you please add in Essential.Templating.Razor.Template and overload for ResolveLayout like this:
protected ITemplate ResolveLayout(string name, object model, Dictionary<string, object> contextEnvironment)
{
if (string.IsNullOrEmpty(name))
return (ITemplate) null;
Template template = this._templateContext.Resolve(name, model, this.Culture, (IDictionary<string, object>) contextEnvironment);
if (template == null)
throw new InvalidOperationException("Layout template was not found.");
else
return (ITemplate) template;
}

And, in TemplateContext an overload for Resolve with model.

Do you see any this wrong with that?

Best regards,
Mihai M

After upgrade - error started occuring?

Hi,

After nuget upgrade to - any ideas....

----> Essential.Templating.Common.TemplateEngineException : This kind of usage is no longer supported!
----> System.NotSupportedException : This kind of usage is no longer supported!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.