A
A
Alexey Lebedev2018-09-20 10:13:45
IIS
Alexey Lebedev, 2018-09-20 10:13:45

How to install Newtonsoft.Json.dll by simple copy?

I installed Newtonsoft.Json.dll to wwwroot\bin . Just copied, on this server you can only do this.
Got such an error.

Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I tried adding this to wwwroot.
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="11.0.2.21924"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>

Newtonsoft.Json: 11.0.2.21924
IIS: IIS8
I have seen a lot of solutions when it comes to reinstalling a project. But we are global here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Glebov, 2018-09-27
@GLeBaTi

In your bindingRedirect it is written that if the project refers to assemblies 0.0.0.0-10.0.0.0, then give it assembly 11.0.2.21924 instead. But this assembly is not present, therefore an error. Try like this:

<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="11.0.0.0"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question