I am working on an ASP.NET project in which I need to do simple HTML templating.
The prettiest solution seems to be RazorEngine, which depends on Microsoft.AspNet.Razor. However, when trying to install Microsoft.AspNet.Razor via Nuget, the following error message is shown:
Installing 'Microsoft.AspNet.Razor 3.0.0'.
Successfully installed 'Microsoft.AspNet.Razor 3.0.0'.
Adding 'Microsoft.AspNet.Razor 3.0.0' to EBulkDBSManagementApp.
Uninstalling 'Microsoft.AspNet.Razor 3.0.0'.
Successfully uninstalled 'Microsoft.AspNet.Razor 3.0.0'.
Install failed. Rolling back...
Could not install package 'Microsoft.AspNet.Razor 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Any solution?
The latest RazorEngine 3.4.0 NuGet package depends on the Microsoft.AspNet.Razor 3.0.0 NuGet package which requires .Net 4.5
If you wish to use RazorEngine with a version of .NET prior to 4.5, then you will need to use the RazorEngine 3.3.0 NuGet pacakage.
You can install this using the package manager console with the following command.
Install-Package RazorEngine -Version 3.3.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With