简体   繁体   中英

Using Fluent Automation, I receive a JSON.Net error

{"Could not load file or assembly 'Newtonsoft.Json, Version=4.5.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)":"Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"}

I get the above error when loading a page with Fluent Automation in Visual studio. The error happens when I execute the following assertion : I.Expect.Exists("#sampleId") .
I am using latest versions of Newtonsoft Json and Fluent Automation. Has anyone been able to solve this recently?

It sounds to me like Fluent Automation is itself referencing an older version of Newtonsoft.Json (4.5.0.0), and you say you are using the latest, which I believe is 6.0.1 Have you tried bindingRedirects?

Here's an example, it goes in your web.config/app.config:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <!-- Any other dependentAssembly bindings you need -->
        <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM