Nustacheを使ってクライアントとサーバーの口ひげテンプレートを共有しようとしていますが、Nustacheは私のアプリでうまく動かないだけです。ソースコードでMVCアプリケーションのコードをそのまま使用しましたが、ビューエンジンを設定または追加しようとするたびにエラーが発生しています。ここでは、コードスニペットは、(アクションメソッドから、私ものglobal.asaxでグローバルビューエンジンを追加しようとしたし、同じエラーを持っていた)です:Nustache View Engine 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
...
これをどのように修正しましたか? –
これは答えではありません... –