aspnet/Razor

razor predefined type system.tuple is defined in multiple assemblies

SomeAreDead opened this issue · 3 comments

I think there is an issue with the Tuple reference in Razor. We upgraded to .NET 4.5 and now we get a "predefined type system.tuple is defined in multiple assemblies" from within the Razor assemblies

StackTrace " at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Compilation\DirectCompilerServiceBase.cs:line 106\r\n at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 256\r\n at RazorEngine.Templating.TemplateService.GetTemplate[T](String razorTemplate, Object model, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 374\r\n at RazorEngine.Templating.TemplateService.GetTemplate(String razorTemplate, Object model, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 352\r\n at RazorEngine.Templating.TemplateService.Resolve(String cacheName, Object model) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 570\r\n at RazorEngine.Razor.Resolve(String cacheName, Object model) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Razor.cs:line 536\r\n at Applaud.Library.Infrastructure.Templating.TemplateBuilder.Build(String ressourceName, Object model) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Infrastructure\Templating\TemplateBuilder.cs:line 38\r\n at Applaud.Library.Infrastructure.Email.NotifierBase.BuildTemplate(String emailResourceName, Object data) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Infrastructure\Email\NotifierBase.cs:line 86\r\n at Applaud.Library.Infrastructure.Email.NotifierBase.BuildHtmlTemplate(String emailResourceName, Object data, Boolean stripped) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Infrastructure\Email\NotifierBase.cs:line 161\r\n at Applaud.Library.Business.CESR.CESRNotifier.GetBody(String cesrEmailType, Object data) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Business\CESR\CESRNotifier.cs:line 41\r\n at Applaud.Library.Data.Service.CESRMailService.LogMailToSend(Guid cesrGUID, String cesrEmailType, String contextId, String to, Object data) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Data\Service\CESRMailService.cs:line 45\r\n at Applaud.Library.Data.Service.CESRManagementService.AddQuery(AddQueryRequest aqr) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Applaud.Libraries\Data\Service\CESRManagementService.cs:line 692\r\n at Portal.App.CESR.CESRManagementController.AddQuery(AddQueryRequest aqr) in C:\SGSTFS\SSC-Cosmos\Main-dev\Source\Portal\App\CESR\CESRManagementController.cs:line 331\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)" string

Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem.

I'm afraid not, a new project made with the same Visual Studio cannot suffer the same problem. I appears to be because the libraries used by Razor are older than those in later versions of VS. I hace found other similar cases with other .NET tools but not Razor, those cases were all solved by updating the versions of .NET used by the tools/utilities

Thanks @SomeAreDead.
Unfortunately we can't help you much without a repro project. Also it seems like you're using a third party Razor engine in your app. Maybe a good place to raise this issue would be in their repo.