warnings - html.helpers not recognized after project update

后端 未结 1 723
遇见更好的自我
遇见更好的自我 2020-12-14 08:18

i recently updated my project to mvc 5, EF 6. i updated all the packages via package console manager (update-package).

Now i see tons of warnings about the html help

相关标签:
1条回答
  • 2020-12-14 08:47

    I see two issues immediately in your global web.config.

    First, this line

    <add key="webpages:Version" value="2.0.0.0" />
    

    Needs to be updated to this line

    <add key="webpages:Version" value="3.0.0.0" />
    

    Second, these lines

    <dependentAssembly>
      <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    

    Needs to be updated to these lines

    <dependentAssembly>
      <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
      <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
    </dependentAssembly>
    

    The assembly versions need to match what you have upgraded to. Also, after making these changes, you may need to do a clean/rebuild in VS to ensure you have cleared the old assemblies out.

    0 讨论(0)
提交回复
热议问题