我想將MVC期貨添加到我的項目中,並使我的Spark視圖中的程序集可用。然而它並不接受它。在Spark視圖引擎中集成MVC期貨而不會導致智能感知
我可以從我的課程(控制器/模型, 等)使用Microsoft.Web.Mvc罰款,但它們只是沒有顯示在.spark文件中。
我不能使用<use assembly""/>
,因爲這會殺死我的智能感知。和 如果我嘗試添加<use namespace='Microsoft.Web.Mvc" />
它不是 找到.Web
。
我也不能在web.config
火花部分添加程序集,因爲它也會殺死 IntelliSense。
此:
public void RegisterViewEngines(ViewEngineCollection engines)
{
if (engines == null) throw new ArgumentNullException("engines");
var settings = new SparkSettings();
settings.SetAutomaticEncoding(true);
settings
.AddNamespace("System")
.AddNamespace("System.Collections.Generic")
.AddNamespace("System.Linq")
.AddNamespace("System.Web.Mvc")
.AddNamespace("System.Web.Mvc.Html")
.AddNamespace("Microsoft.Web.Mvc");
settings
.AddAssembly("Microsoft.Web.Mvc")
.AddAssembly("Spark.Web.Mvc")
.AddAssembly("System.Web.Mvc, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35")
.AddAssembly("System.Web.Routing, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35");
engines.Add(new SparkViewFactory(settings));
}
拋出沒有任何錯誤,不殺我的Sspark文件智能感知,但 它也似乎想導入部件甚至還沒有。
Microsoft.Web.Mvc.dll設置爲Copy Local to running bin。
我在忽略什麼?
有關這方面的消息嗎? – 2009-08-18 11:55:37
由於ASP.net視圖引擎不斷讓我越來越多,所以我在此打開了一個賞金。 – 2009-10-15 08:37:53