Skip to main content

It looks like you are missing a using statement:

Message: c:\inetpub\wwwroot\sc92sc.dev.local\Views\SimpleComponent\Title.cshtml(3): 
    error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Sxa' 
    and no extension method 'Sxa' accepting a first argument of type 
    'System.Web.Mvc.HtmlHelper' could be found (are you missing a using 
    directive or an assembly reference?)

Make sure that either your Title.cshtml has:

@using Sitecore.XA.Foundation.SitecoreExtentionsSitecoreExtensions

or that you have added that to your system.web.webPages.razor<namespaces> namespaceselement in the /views/web.config file:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
        <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Sitecore.Mvc" />
            <add namespace="Sitecore.Mvc.Presentation" />
            <add namespace="Sitecore.XA.Foundation.SitecoreExtensions" />
        </namespaces>
    </pages>
</system.web.webPages.razor>

It looks like you are missing a using statement:

Message: c:\inetpub\wwwroot\sc92sc.dev.local\Views\SimpleComponent\Title.cshtml(3): 
    error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Sxa' 
    and no extension method 'Sxa' accepting a first argument of type 
    'System.Web.Mvc.HtmlHelper' could be found (are you missing a using 
    directive or an assembly reference?)

Make sure that either your Title.cshtml has:

@using Sitecore.XA.Foundation.SitecoreExtentions

or that you have added that to your system.web.webPages.razor namespaces in the /views/web.config file:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
        <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Sitecore.Mvc" />
            <add namespace="Sitecore.Mvc.Presentation" />
            <add namespace="Sitecore.XA.Foundation.SitecoreExtensions" />
        </namespaces>
    </pages>
</system.web.webPages.razor>

It looks like you are missing a using statement:

Message: c:\inetpub\wwwroot\sc92sc.dev.local\Views\SimpleComponent\Title.cshtml(3): 
    error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Sxa' 
    and no extension method 'Sxa' accepting a first argument of type 
    'System.Web.Mvc.HtmlHelper' could be found (are you missing a using 
    directive or an assembly reference?)

Make sure that either your Title.cshtml has:

@using Sitecore.XA.Foundation.SitecoreExtensions

or that you have added that to your <namespaces> element in the /views/web.config file:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
        <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Sitecore.Mvc" />
            <add namespace="Sitecore.Mvc.Presentation" />
            <add namespace="Sitecore.XA.Foundation.SitecoreExtensions" />
        </namespaces>
    </pages>
</system.web.webPages.razor>
Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79

It looks like you are missing a using statement:

Message: c:\inetpub\wwwroot\sc92sc.dev.local\Views\SimpleComponent\Title.cshtml(3): 
    error CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Sxa' 
    and no extension method 'Sxa' accepting a first argument of type 
    'System.Web.Mvc.HtmlHelper' could be found (are you missing a using 
    directive or an assembly reference?)

Make sure that either your Title.cshtml has:

@using Sitecore.XA.Foundation.SitecoreExtentions

or that you have added that to your system.web.webPages.razor namespaces in the /views/web.config file:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
        <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Sitecore.Mvc" />
            <add namespace="Sitecore.Mvc.Presentation" />
            <add namespace="Sitecore.XA.Foundation.SitecoreExtensions" />
        </namespaces>
    </pages>
</system.web.webPages.razor>