NuGet adds rogue string to web.config MVC4

Each time I install ANYTHING using Nuget, this is added to my section <Runtime><asseblyBinding>in my web.config:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>

Obviously I'm using MVC4, so links to Razor 2.0.0.0 break things and the following runtime error occurs.

Could not load type 'System.Web.Razor.Parser.SyntaxTree.CodeSpan' from assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

It is easy to fix, just delete the rouge section from Web.Config, but it’s very annoying! Does anyone know why this might happen, or how to fix it?

I am using Nuget Package Manager version 1.7.30402.9028

+3
source share
1 answer

, PowerShell, , , . , -, Razor, , JQuery?

,

0

All Articles