asp.net-mvc
  • spark-view-engine
  • asp.net-mvc-futures
  • 2009-07-13 20 views 3 likes 
    3

    我想將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。

    我在忽略什麼?

    +0

    有關這方面的消息嗎? – 2009-08-18 11:55:37

    +0

    由於ASP.net視圖引擎不斷讓我越來越多,所以我在此打開了一個賞金。 – 2009-10-15 08:37:53

    回答

    2

    嗯,我不知道這是否能夠解決您的問題,但這裏是我的web.config與火花部:

    <spark> 
        <compilation debug="true"/> 
        <pages automaticEncoding="true" pageBaseType="xx.Web.SparkModelViewPage"/> 
    </spark> 
    

    pageBaseType是從MvcContrib

    支持HTML流利

    ,並在_Global.spark文件我得到這個:

    <use namespace="System"/> 
    <use namespace="System.Linq"/> 
    <use namespace="System.Web.Mvc"/> 
    <use namespace="System.Web.Mvc.Html"/> 
    <use namespace="System.Web.Routing"/> 
    <use namespace="System.Collections.Generic"/> 
    <use namespace="xxx.Web"/> 
    <use namespace="MvcContrib"/> 
    <use namespace="MvcContrib.UI"/> 
    <use namespace="MvcContrib.UI.Grid"/> 
    <use namespace="MvcContrib.UI.Pager"/> 
    <use namespace="MvcContrib.UI.Grid.ActionSyntax"/> 
    <use namespace="MvcContrib.FluentHtml"/> 
    <use namespace="MvcContrib.FluentHtml.Elements"/> 
    <use namespace="Microsoft.Web.Mvc"/> 
    <use namespace="Microsoft.Web.Mvc.Controls"/> 
    <use namespace="xVal.Html"/> 
    

    我嘗試添加的命名空間在web.config中火花部,但它殺死智能感知。

    相關問題