Does RazorEngine require MVC3 to be installed?

Posted by tkha007 on Stack Overflow See other posts from Stack Overflow or by tkha007
Published on 2012-07-11T03:12:53Z Indexed on 2012/07/11 3:15 UTC
Read the original article Hit count: 158

Filed under:

I am working on a web project that uses MVC2. I decided to try out RazorEngine to do some e-mail templating. This appeared to work fine when I was protyping using an MVC2 project so I assumed that RazorEngine will work fine for my e-mail templating solution. What I had forgotten at the time was that I actually had MVC3 installed on my local development machine.

After deploying the project on a pre-test server I get the following error in the logs when the application attempts to do anything with RazorEngine:

Could not load file or assembly 'System.Web.Razor, Version=1.0.0.0, Culture=neutral,      PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The system cannot find the file specified.
File name: 'System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at RazorEngine.Compilation.DefaultCompilerServiceFactory.CreateCompilerService(Language language)
at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType)
at RazorEngine.Templating.TemplateService.CreateTemplate[T](String razorTemplate, T model)
at RazorEngine.Templating.TemplateService.Parse[T](String razorTemplate, T model)
at RazorEngine.Razor.Parse[T](String razorTemplate, T model)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Persistence.Utility.RazorEngineHelper.Parse(String templateName, Object model) in

The fact that it can't find 'System.Web.Razor' means that this DLL does not exist on the deployed server. The only difference I can think of between the deployment server and my local dev machine is that the deployment server does not have MVC3 installed but I may be mistaken because the deployment server is not something I normally control and as such I don't have a lot of information about it. It is meant to host this particular application so there have been previous deployments of this application to this server. This is the first time I'm making a deployment with RazorEngine as a dependency.

© Stack Overflow or respective owner

Related posts about Razor