Integrate MVC futures into Spark engine without killing IntelliSense

I want to add MVC futures to my project and make the build available in Spark . However, he does not accept it at all.

I can use Microsoft.Web.Mvc in my classes (controllers / models, etc.), but they just don't show up in .spark files.

I can not use <use assembly""/>, as this kills my IntelliSense. And also if I try to add <use namespace='Microsoft.Web.Mvc" />, this is not a finding .Web.

I also cannot add assemblies to spark sections web.config, as this kills IntelliSense too.

It:

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));
}

It does not cause errors and does not kill my IntelliSense in Sspark files, but it also does not seem to want to import the assembly still motionless.

Microsoft.Web.Mvc.dll .

?

+3
1

Hum , , web.config Spark:

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

pageBaseType - HTML- MvcContrib

_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, intellisense.

+2

Source: https://habr.com/ru/post/1712515/


All Articles