How to reference version 1.1.0.0 of System.Web.Optimization assembly
Asked Answered
B

2

5

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.

Barry answered 24/9, 2013 at 8:40 Comment(0)
B
3

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

Barry answered 27/9, 2013 at 4:45 Comment(1)
I deleted my entire bin folder, then I performed steps 4 and 5 above. Thanks for the tip.Danettedaney
V
7

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

Vowelize answered 24/9, 2013 at 12:24 Comment(2)
I still received the same message. after doing what you suggested. Though the new version is installed, the 'System.Web.Optimization dll' remains the older version (version 1.0.0.0). It seems as if the nuget package is not updating that dll. I am still lost. Please any suggestionBarry
Remove the reference to the old dll (1.0.0), remove the entry in packages.config (1.1.0) and then install the NuGet package again.Vowelize
B
3

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

Barry answered 27/9, 2013 at 4:45 Comment(1)
I deleted my entire bin folder, then I performed steps 4 and 5 above. Thanks for the tip.Danettedaney

© 2022 - 2024 — McMap. All rights reserved.