【发布时间】:2009-07-13 22:30:26
【问题描述】:
我想将 MVC 期货添加到我的项目中,并使程序集在我的 Spark 视图中可用。但是它不接受它。
我可以在我的课程中很好地使用 Microsoft.Web.Mvc(控制器/模型, 等),但它们只是没有出现在 .spark 文件中。
我不能使用<use assembly""/>,因为这会杀死我的 IntelliSense。和
如果我尝试添加 <use namespace='Microsoft.Web.Mvc" /> 它不是
找到.Web。
我也无法在 web.config spark 部分添加程序集,因为这会杀死
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 文件中的 IntelliSense,但是 它似乎也不想导入程序集。
Microsoft.Web.Mvc.dll 也设置为 Copy Local to the running bin。
我忽略了什么?
【问题讨论】:
-
我为此开了一个赏金,因为 ASP.net 视图引擎让我越来越生气:)。
标签: asp.net-mvc spark-view-engine asp.net-mvc-futures