Razorlight: "Could not load type 'RazorLight.RazorLightExtensions' from assembly 'RazorLight, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'."

Created on 19 Oct 2018  路  4Comments  路  Source: toddams/RazorLight

Describe the bug
Just installed <package id="RazorLight" version="2.0.0-beta1" targetFramework="net472" /> as a requirement for FluentEmail.Razor project. When trying to send the e-mail the app breaks with this exception:

"Could not load type 'RazorLight.RazorLightExtensions' from assembly 'RazorLight, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'."

Expected behavior
FluentEmail.Razor should just work because it requires RazorLight 2.0.0-alpha3.

Information (please complete the following information):

  • OS: [ Windows 10 ]
  • Platform [ .NET Framework 4.7.2 ]
  • RazorLight version [ e.g 2.0.0-beta1 ]
waiting for feedback

Most helpful comment

I have same issue

All 4 comments

I have same issue

@leniel If you're using .NET Framework 4.7.2, then are you also using auto generate binding redirects? Also, Are you using the old or new style csproj file format?

Note to self: I beleive this issue has more or less resolved itself due to FluentEmail upgrading to beta1 and users using beta1, but since we've published beta2 and beta3 in the last month, I suspect this issue could come back. The fundamental problem is a .NET Linker issue as opposed to a RazorLight issue, but the bugs are filed against open source library owners instead of Microsoft, because there is an under-education in the .NET community about how the hell the .NET Linker works across .NET Framework and .NET Core.

RazorLightExtensions no longer exists.

Was this page helpful?
0 / 5 - 0 ratings