试图使用Nustache共享客户端和服务器胡须模板,但Nustache只是不能很好地与我的应用程序一起玩。我直接从源代码中的MVC应用程序示例中使用代码,但每次尝试设置或添加视图引擎时都会出现错误。下面是一个代码片段(来自一个操作方法,我也试着在Global.asax中添加全局视图引擎,并有同样的错误):Nustache查看引擎ArrayTypeMismatchException
ViewResult viewResult = View(new { test = "Jawesome" });
viewResult.ViewEngineCollection = new ViewEngineCollection
{
new NustacheViewEngine()
};
而这里的错误:
[ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.]
System.Collections.Generic.List`1.Insert(Int32 index, T item) +62
MyController.Index() in C:\src\projects\myproject\myproject.Web\Controllers\MyController.cs:83
lambda_method(Closure , ControllerBase , Object[]) +79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264
...
您是如何解决这个问题的? – 2012-03-03 15:24:08
这不是一个答案... – 2015-12-20 22:53:19