You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been using the v3.0.0 of FluentEmail.Core along with FluentEmail.Liquid with no problems for the past year or so, however, I have upgraded NSwag to the latest version and now we are unable to create emails due to the following error being thrown:
Error. System.TypeLoadException: Could not load type 'Fluid.BaseFluidTemplate`1' from assembly 'Fluid, Version=0.0.0.0, Culture=neutral, PublicKeyToken=omit'. at FluentEmail.Liquid.LiquidRenderer.ParseAsync[T](String template, T model, Boolean isHtml) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at FluentEmail.Liquid.LiquidRenderer.ParseAsync[T](String template, T model, Boolean isHtml) at FluentEmail.Liquid.LiquidRenderer.Parse[T](String template, T model, Boolean isHtml) at FluentEmail.Core.Email.UsingTemplateFromFile[T](String filename, T model, Boolean isHtml)
Looking through release notes for NSwag 13.15.0 it seems they have migrated to use Fluid, I suspect there could be a mismatch of dependencies now between libs. I've been unable to diagnose the issue any further thus far but any help would be appreciated.
Reacted by Justin Chew, Henry Ing-Simmons and jstafford5380
Bumped into same problem. In my case I was using Fluid.Core 2.9 package in another part of my application. This caused issues with Liquid Renderer. I assume that there was a breaking change in Fluid.Core and their recent versions are not compatible with the one used by FluentEmail.
Ran into the same problem. NJsonSchema uses Fluid 2.9 and it appears this version of FluentEmail.Liquid uses Fluid.Core >= 2.0.13 but BaseFluidTemplate.cs appears to have been deleted by Fluid.Core 2.0. I cannot find a reference to it in the FluentEmail.Liquid library however, despite the error.
This renderer is working fine in another project of mine but I noticed when I installed it, it pulled in Fluid.Core 1.0. Not sure why... but that works. Unfortunately, since other things like NJsonSchema have a dependency on a later version, I seem have to choose on or the other; emails or jsonschemas...
It seems to happen when the control returns to the ParseAsync method here:
From here I am lost. I still don't see any reference to BaseFluidTemplate but I would have guessed this FluidTemplate class was previously derived from BaseFluidTemplate and I confirmed that here in their 1.0 tag:
Activity
kolemasov commentedon Apr 28, 2024
Bumped into same problem. In my case I was using Fluid.Core 2.9 package in another part of my application. This caused issues with Liquid Renderer. I assume that there was a breaking change in Fluid.Core and their recent versions are not compatible with the one used by FluentEmail.
jstafford5380 commentedon Sep 3, 2024
Ran into the same problem. NJsonSchema uses Fluid 2.9 and it appears this version of
FluentEmail.LiquidusesFluid.Core >= 2.0.13butBaseFluidTemplate.csappears to have been deleted by Fluid.Core 2.0. I cannot find a reference to it in theFluentEmail.Liquidlibrary however, despite the error.This renderer is working fine in another project of mine but I noticed when I installed it, it pulled in
Fluid.Core1.0. Not sure why... but that works. Unfortunately, since other things like NJsonSchema have a dependency on a later version, I seem have to choose on or the other; emails or jsonschemas...It seems to happen when the control returns to the
ParseAsyncmethod here:FluentEmail/src/Renderers/FluentEmail.Liquid/LiquidRenderer.cs
Line 53 in e1379c4
Which is the first time it tries to do anything with the viewTemplate which was parsed earlier on, here:
FluentEmail/src/Renderers/FluentEmail.Liquid/LiquidRenderer.cs
Line 91 in e1379c4
Turns out that TryParse is actually an extension method on the
Fluid.Corelibrary which calls another extension methodParsehere:https://github.com/sebastienros/fluid/blob/575077f06517f99c95d8ecfcee13b805659673e2/Fluid/FluidParserExtensions.cs#L14
And returns the fluid template where
RenderAsyncis being called:https://github.com/sebastienros/fluid/blob/0de3b07a5eeba650d69f19849fa62255fa1b4ca9/Fluid/Parser/FluidTemplate.cs#L20
From here I am lost. I still don't see any reference to BaseFluidTemplate but I would have guessed this
FluidTemplateclass was previously derived fromBaseFluidTemplateand I confirmed that here in their 1.0 tag:https://github.com/sebastienros/fluid/blob/b4400c4d8361709fdb235bfdfe01b6998327f1d3/Fluid/FluidTemplate.cs#L3
Sooooo.... I don't know what's goin on. Some sort of phantom reference?