Domanda

I am currently trying to use a file upload called the Jquery-File-Upload by BlueImp in my MVC 4 application via nugget. This file upload depends on System.Web.Optimization namespace to work.

My application keeps throwing this error:

Error 9 Assembly 'Backload, Version=1.9.3.0, Culture=neutral, PublicKeyToken=02eaf42ab375d363' uses 'System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I tried adjusting the web.config thus

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

and I still keep getting the same message.

I have googled and found links asking to install Microsoft.AspNet.Web.Optimization via nugget, which I did and yet no problem solved.

Please how do I add the version 1.1.0.0 of System.Web.Optimization.dll.

È stato utile?

Soluzione 2

This was how i resolved this issue. First i followed the @helgans comment under his answer and still kept getting the reference to version 1.0.0 of system.web.optimization in the reference folder. I also deleted the dll from the bin folder of my website and reference version 1.1.0 from another project, yet the same problem persist.

In solving the problem, I discovered that the older version was being copied from the library folder in my application (well i do not know how). This makes the referenced version remain version 1.0.0, even if i referenced version 1.1.0 from another project or re-install the NuGet package again.

To solve this problem, i did the following:

  1. I deleted the dll from the Library folder.
  2. Removed the reference of the older version (thanks to @helgans)
  3. Removed the dll from the bin folder
  4. Unistall the package: Uninstall-Package Microsoft.AspNet.Web.Optimization -Force
  5. Re-install the package

The NuGet now adds reference to version 1.1.0

Altri suggerimenti

This is, because Backload internally references Microsoft.AspNet.Web.Optimization version 1.1.0. In a new MVC project you typically reference the older 1.0.0 version. You only need to update to the new one:

Right click references in your project, select Manage NuGet packages and in the upcoming dialog select Updates on the left pane. Then, in the middle pane, look for "Microsoft ASP.NET Web Optimization Framework" version 1.1.0

NuGet: http://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/

Described here: http://docs.nuget.org/docs/start-here/managing-nuget-packages-using-the-dialog

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top