Unable to compile template

Jun 30, 2011 at 3:55 PM
Edited Jun 30, 2011 at 3:55 PM

Hello!

Well I've run into a strange problem, which I've searched for a solution during 2 days...

I have multiple computers, same codes shared through svn. The template compile works on some pcs, but not on some others... 

Here is the simple code part which causes problem:

template = Razor.Parse(template, new { Datetime = "date", Actor = "actor", StepDescr = "descr", Link = "link"; }

This is the error on parsing:

Unable to compile template. Check the Errors list for details.   

at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context)
   at RazorEngine.Templating.TemplateService.CreateTemplate(String template, Type modelType)
   at RazorEngine.Templating.TemplateService.GetTemplate(String template, Type modelType, String name)
   at RazorEngine.Templating.TemplateService.Parse[T](String template, T model, String name)
   at RazorEngine.Razor.Parse[T](String template, T model, String name)
   at LivingDocuments.Services.MailTemplateManager.FillStepText(Boolean isHtml, MailTypeCode mailTypeCode, Decimal StepID, Decimal CompanyID, User actor, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Services\MailTemplateManager.cs:line 106
   at LivingDocuments.Services.MailTemplateManager.GetStepMail(MailTypeCode mailTypeCode, Decimal StepID, Step StepDefinition, User connectedUser, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Services\MailTemplateManager.cs:line 53
   at LivingDocuments.Services.MailManager.SendStepMail(Decimal StepID, Step StepDefinition, User connectedUser, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Services\MailManager.cs:line 102
   at LivingDocuments.Data.Workflow.Steps.ValidationStep.EnterStepStepRevision(User connectedUser, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Data.Workflow\Steps\ValidationStep.cs:line 24
   at LivingDocuments.Data.Workflow.Steps.StepRevision.EndStepAndMakeTransitions(User connectedUser, String comment, String eventName, String xmlEventParams, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Data.Workflow\Steps\StepRevision.cs:line 86
   at LivingDocuments.Data.Workflow.Steps.ValidationStep.SendEventToStepRevision(User connectedUser, String comment, String eventName, String xmlEventParams, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Data.Workflow\Steps\ValidationStep.cs:line 42
   at LivingDocuments.Services.WorkflowService.SendEventToWorflowStepRevisionDecimal(Decimal workflowInstanceID, Decimal stepRevisionID, Decimal stepID, User connectedUser, String comment, String eventName, String xmlEventParams, DbConnection openedConnection) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Services\WorkflowService.cs:line 174
   at LivingDocuments.Services.WorkflowService.<>c__DisplayClassd.b__c(DbTransaction trans) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Services\WorkflowService.cs:line 164
   at LivingDocuments.Data.SqlRepository.DataAccessManager.<>c__DisplayClass4.b__3(DbConnection conn) in D:\LD_Trunk\LivingDocuments\LivingDocuments.Data\SqlRepository\DataAccessManager.cs:line 171

Errors :
{error CS1704: An assembly with the same simple name 'BusinessRuleLibrary.General, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.}
Etc (35 other messages like this one)

Before I found out RazorEngine, I already had MVC3 libraries with a System.Web.Razor.dll assembly. 

I've had it working on some pcs with RazorEngine.dll and System.Web.Razor.dll, but not on some others, which have basically same environment, frameworks and VS2010 installation...

Any idea? Thanks by advance.

Coordinator
Jul 6, 2011 at 7:45 PM

Sounds like the assembly is being imported twice. Can you minimise the problem into its smallest form and email me some code to matt [at] fidelitydesign (dot) net?