templates - Razor Engine not working in ASP.net 5 MVC 6 -


i trying migrate existing code mvc5 mvc6 , having difficulty particular code:

 engine.razor.runcompile(file.readalltext(emailtemplatepath), "emailtemplatekey", typeof (emailviewmodel), emailviewmodel); 

i receiving following runtime error:

missingmethodexception: method not found: "void microsoft.aspnet.razor.codegenerators.generatedclasscontext.set_resolveurlmethodname(system.string)". in razorengine.compilation.compilerservicebase.createhost(type templatetype, type modeltype, string classname) 

the original code using in mvc5 taken here. if there no way of converting above code work mvc6 elegant way of doing email templates?

apparently there has been change in generatedclasscontext class - property resolveurlmethodname not exist anymore, hence missingmethodexception. looks parsercontext class has changed too, since accessing onerror event handler throws same exception.

in fact setter of missing property missing (pardon expression!), which, being method, causes exception. absolutely accurate misleading, unless recall this.

quite similar question (and answer alternative solution!) here: razorengine , mvc 6 beta 7.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -