Could not load file or assembly 'System.Web.Optimization, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'

I keep getting this error even though I have already installed the nuget package for Microsoft.AspNet.Web.Optimization ...

Could not load file or assembly 'System.Web.Optimization, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35'

Apparently the one in Nuget is v.1.13, while my solution has v.1.0.0 somewhere ... The problem is I can't find a way to map the two. I cannot find an installation for v.1.0.0 or a way to uninstall or override 1.0.0 for 1.1.3.

Any help on this?

Any code you need to see please let me know and I'll update the question.

+3


source to share


4 answers


I managed to fix this problem by adding the following to my web.config:



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

      

+3


source


I think you need to change the "Target Structure" from the project properties. ".NET Framework 3.5" should be fine.

One more thing you need to be sure that your target platform is set correctly. You can change it from the project properties under the Build tab . If your running application is 64 bit, change it to x64 otherwise (32 bit), keep it x86 Be careful not to select "Any processor" .



Hope they help you.

Arif.

0


source


I faced the same problem today when switching between branches in GIT.

If you want to use nuget to access a specific version of a package, there is an option -version <value>

for a very batch install that was installed.

Hence, you can write nuge uninstaller and then install the installer of the desired package with additional version information.

0


source


This is how I fixed it. Reinstall the package using the command:

Install-Package Microsoft.AspNet.Web.Optimization

      

If you've already installed it, you need to remove this line from packages.config:

<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />

      

0


source







All Articles