All Versions
21
Latest Version
2.0
Avg Release Cycle
80 days
Latest Release
2194 days ago

Changelog History
Page 1

  • v2.0 Changes

    September 23, 2017

    What is new?

    String rendering is back!

    ๐ŸŽ We added rendering of the strings back! And now they are cached, so you will not be affected by bad performance.

    Note: if you store your templates in database - it is recommended approach to define custom RazorLightProject that fetches templates from database and create RazorLightEngine passing your implementation to it. This way, engine will your RazorLightProject to resolve layouts. String rendering is just another option for some exclusive use cases when you have microservice structure and pass templates between nodes, so you might not need it at all.

    Here is an example of RazorLightProject that uses EntityFramework to get templates from database- https://github.com/toddams/RazorLight/blob/dev-2.0/samples/RazorLight.Samples/Program.cs

    string templateKey = "key";string result = await engine.CompileRenderAsync(templateKey , "Hello @Model.Name", new { Name = "Johny" });//Returns true, so next time you render template with this key - it will not be compiled, but taken from cacheengine.TemplateCache.Contains(templateKey); 
    

    โž• Additional metadata references

    ๐Ÿ“‡ When RazorLight compiles your template - it loads all the assemblies from your entry assembly and creates MetadataReference from it. This is a default strategy and it works in 99% of the time. But sometimes compilation crashes with an exception message like "Can not find assembly My.Super.Assembly2000". In order to solve this problem you can pass additional metadata references to RazorLight.

    var options = new RazorLightOptions();var metadataReference = MetadataReference.CreateFromFile("path-to-your-assembly")options.AdditionalMetadataReferences.Add(metadataReference );var project = new FileSystemRazorProject("path-to-your-views");var engine = new EngineFactory().Create(project, options);
    
  • v2.0.0-rc.2 Changes

    November 18, 2020

    ๐Ÿ‘ป #391 - Change exception type/message when project item does not exist (@maxbanas) - to help people troubleshoot issues like #378
    ๐Ÿ›  #392 - Change targeting for .Net standard 2.0 (@Vincentvwal) - Fixes #390

    Generated from: https://github.com/toddams/RazorLight/milestone/11?closed=1

  • v2.0.0-rc.1 Changes

    November 17, 2020
    • โœ‚ Removed Obsolete InplaceStringBuilder and replaced with stringbuilder. #380 (@ADNewsom09)
      • required for .NET 5.0 support to work
    • ๐Ÿ‘ .NET 5.0 support #389 (@nm-a)
  • v2.0.0-beta9 Changes

    June 24, 2020

    ๐Ÿ›  #349 - Fixes #349 dotnet pack bug causes .netcoreapp3.1 TFM projects issues @(@jzabroski)

  • v2.0.0-beta8 Changes

    June 21, 2020

    ๐Ÿ›  #335 - Fixed spelling errors in the code (@SimonCropp)
    โœ… #309 - Added regression tests for common Razorlight renderer cases (@weyert)
    โœ… #346 - Introduce Verify for section approval tests (@SimonCropp)

  • v2.0.0-beta7 Changes

    March 27, 2020
  • v2.0.0-beta6 Changes

    March 26, 2020
    • ๐Ÿ›  Fixes #311 (via @HakanL PR #312): Incorrect template key when using constructor that takes assembly.
    • ๐Ÿš€ Release Management improvement: Cleaned up Sandbox, Sample and RazorLight.Precompile projects to have IsPackable=False
  • v2.0.0-beta5 Changes

    March 18, 2020
  • v2.0.0-beta4

    December 19, 2019
  • v2.0.0-beta3

    December 19, 2019