FluentEmail icon indicating copy to clipboard operation
FluentEmail copied to clipboard

No overload for method 'CompileRenderAsync' takes 4 arguments

Open jez9999 opened this issue 4 years ago • 1 comments

My .csproj has the following references:

    <PackageReference Include="FluentEmail.Core" Version="2.7.0" />
    <PackageReference Include="FluentEmail.Razor" Version="2.7.0" />
    <PackageReference Include="FluentEmail.Smtp" Version="2.7.1" />
    <PackageReference Include="RazorLight" Version="2.0.0-beta4" />

I setup the FluentEmail DI like so (from Startup.cs):

    services
        .AddFluentEmail(defaultFromEmail, defaultFromName)
        .AddRazorRenderer(typeof(Program))
        .AddSmtpSender(smtpHost, smtpPort);

And then when I call the following:

    await _email
        .To("[email protected]")
        .Subject("Test subject")
        .UsingTemplateFromEmbedded($"DocComs.Common.Email.TemplatesHtml.{templateName}", vars, Assembly.GetExecutingAssembly())
        .SendAsync();

... I get the exception:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'No overload for method 'CompileRenderAsync' takes 4 arguments'

So I'm using the latest beta of RazorLight but there seems to be a binding error from FluentEmail :-(

If this is fixed in a beta version of FluentEmail then could you please publish these betas to nuget.org? I don't see any there right now.

jez9999 avatar Mar 13 '20 13:03 jez9999

@jez9999 I am facing the same issue. I noticed some changes between beta001 and beta007 (current) regarding the use of Assemblies.

Downgrading to beta01 fixed this specific error for me.

Now i am facing missing netstandard2.0 types.

Used https://github.com/lukencode/FluentEmail/issues/184#issuecomment-615192007 as workaround

mkoertgen avatar May 09 '20 09:05 mkoertgen