Extent reports has a dependency on newtonsoft json with null publickeytoken causing build failure
Getting a compile error when trying to use ExtentReports in a project that already references newtonsoft.json.
Error CS0433 The type 'JObject' exists in both 'ExtentReports, Version=3.0.2.0, Culture=neutral, PublicKeyToken=null' and 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
Duplicated by #77
Workaround:
-
In the Visual Studio's Properties window for the project's Newtonsoft.Json reference, change the value of Aliases from
globaltoglobal, foo. -
Insert
extern alias foo;as the first line of any class that consumes Newtonsoft.Json. -
Qualify members with
foo.. Example:foo.Newtonsoft.Json.JsonConvert.SerializeObject(someObject)}.