tichra
tichra

Reputation: 553

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?

Upvotes: 0

Views: 335

Answers (1)

hsrob
hsrob

Reputation: 179

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>

Upvotes: 3

Related Questions