1

My project is on MVC 4. In it I can't access any of scripts function like @Scripts.Render("~/bundles/modernizr") as Scripts is an ambigious reference between 'System.Web.WebPages.Scripts' and 'System.Web.Optimization.Scripts'

I have following entries in my webconfig :

<pages>
      <namespaces>
        <add namespace="System.Web.Helpers"/>
        <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="System.Web.WebPages"/>
        <add namespace="Product360"/>
      </namespaces>
    </pages>

I updated System.web.optimization from package manager console, still it's showing me same error.

I can't figure out why it's intellisensing in System.web.WebPages instead of System.web.optimization.

Anyone has any updates on this?

4

1 回答 1

0

您使用 WebMaxtrix / Web Pages 还是仅使用 ASP.NET MVC?如果你只使用 MVC 摆脱这一行

<add namespace="System.Web.WebPages"/>

你不应该再有冲突了。

注意:您可能需要重新启动 Visual Studio,以便在修改后在 cshtml 文件中正确处理命名空间。

于 2012-12-11T12:55:51.727 回答