XWiśniowiecki
XWiśniowiecki

Reputation: 1843

RazorJS - Could not load type 'System.Web.Razor.Parser.MarkupParser'

When I try to use @Html.RazorJSInline() function I get

Could not load type 'System.Web.Razor.Parser.MarkupParser'

When I try to use @Html.RazorJSInclude() RazorJs is generating path to JS file but then I get the same error when trying to open the file with browser.


edit

I think it is caused by that the RazorJS was designed for Razor 1...

Does anybody find out some nice workaround?

Upvotes: 4

Views: 1537

Answers (1)

Thomas Mulder
Thomas Mulder

Reputation: 779

Got here a bit late, but I hit a similar problem when trying to call RazorEngine's Razor.Parse(). I also got this message:

Could not load type 'System.Web.Razor.Parser.MarkupParser'

I was at the time using RazorEngine version 3.0.8. This issue was apparently resolved in a later version of RazorEngine (3.1.0) So upgrading the package to this version fixed it for me. I used the following command in the NuGet Package Manager Console to upgrade to the fixed version:

PM> Update-Package RazorEngine -Version 3.1.0

At the moment, RazorEngine is already a bunch of versions further (I think currently 3.7.2) but upgrading all the way to this version wasn't really an option for us, as this would've required quite a bit of refactoring in existing code. If this isn't an issue for you, you could always try the latest version.

Upvotes: 4

Related Questions