Changelog History
Page 1
-
v2.0 Changes
September 23, 2017What 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 #390Generated 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)
- โ Removed Obsolete InplaceStringBuilder and replaced with stringbuilder. #380 (@ADNewsom09)
-
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 forsection
approval tests (@SimonCropp) -
v2.0.0-beta7 Changes
March 27, 2020- ๐ Fixes #322 via commit 2d9c031 (@jzabroski )
-
v2.0.0-beta6 Changes
March 26, 2020 -
v2.0.0-beta5 Changes
March 18, 2020- ๐ Fixes #287 via #310 (@matthewwren viz a viz @chancie86 )
-
v2.0.0-beta4
December 19, 2019 -
v2.0.0-beta3
December 19, 2019