Several pieces of functionality in my code use Newtonsoft 11.0.0
Now working on Stripe implementation and the first time the Stripe API is called I get this exception.
System.IO.FileLoadException
Could not load file or assembly 'Newtonsoft.Json, Version=9.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)
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.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)
File name: 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
at Stripe.EventUtility.ParseEvent(String json, Boolean throwOnApiVersionMismatch)
at Stripe.EventUtility.ConstructEvent(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Boolean throwOnApiVersionMismatch) in /_/src/Stripe.net/Services/Events/EventUtility.cs:line 88
at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at ASP._Page_stConfirm_cshtml.Execute() in h:\root\home\bigbird-001\www\Bnew\stConm.cshtml:line 18
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.StartPage.RunPage()
at System.Web.WebPages.StartPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext)
It seems you are targeting two different versions of Newtonsoft. First settle on the version you want then fix the assembly references to use this version.
stripe.js is a JavaScript file which runs in the browser. NewtonSoft is a library that runs on the server.
wavemaster
Back to my original question... can I have two versions of Newtonsoft side by side, and if yes, how and where does one put this?
As far as I understand Stripe uses a REST API but I'm not sure how you are using it. I'm guessing the version conflict is either a version bug you introduced or maybe you downloaded a 3rd party .NET Stripe API.
Anyway, this is somehting you needed to design up front using a strong name.
My WebDeploy no longer works at SmarterAsp.net, lost overview of what had changed and where.
mgebhard
As far as I understand Stripe uses a REST API but I'm not sure how you are using it.
I'm guessing the version conflict is either a version bug you introduced or maybe you downloaded a 3rd party .NET Stripe API.
Click on "Mark as Answer" if my answers help you along.
Contributor
2619 Points
2753 Posts
Stripe Newtonsoft version issues - use two different versions ?
Feb 24, 2020 05:34 PM|wavemaster|LINK
Several pieces of functionality in my code use Newtonsoft 11.0.0
Now working on Stripe implementation and the first time the Stripe API is called I get this exception.
Someone suggested this little blurb, which I gather means ran two different versions of Newtonsoft at the same time
I have a web.config and packages.config.
Where does this go and what else do I need to do to have these both functional? Will nuget support this scenario?
All-Star
53691 Points
24030 Posts
Re: Stripe Newtonsoft version issues - use two different versions ?
Feb 24, 2020 05:43 PM|mgebhard|LINK
It seems you are targeting two different versions of Newtonsoft. First settle on the version you want then fix the assembly references to use this version.
Contributor
2619 Points
2753 Posts
Re: Stripe Newtonsoft version issues - use two different versions ?
Feb 24, 2020 06:31 PM|wavemaster|LINK
I believe stripe.js is dependent on version 9.
The rest of my code uses version11
Don't really want to downgrade from v 11 to 9 because of my existing api functionality with 3rd parties is all difficult to test.
Back to my original question... can I have two versions of Newtonsoft side by side, and if yes, how and where does one put this?
All-Star
53691 Points
24030 Posts
Re: Stripe Newtonsoft version issues - use two different versions ?
Feb 24, 2020 07:08 PM|mgebhard|LINK
stripe.js is a JavaScript file which runs in the browser. NewtonSoft is a library that runs on the server.
As far as I understand Stripe uses a REST API but I'm not sure how you are using it. I'm guessing the version conflict is either a version bug you introduced or maybe you downloaded a 3rd party .NET Stripe API.
Anyway, this is somehting you needed to design up front using a strong name.
Contributor
2619 Points
2753 Posts
Re: Stripe Newtonsoft version issues - use two different versions ?
Feb 24, 2020 09:08 PM|wavemaster|LINK
Yup, that it was.
My WebDeploy no longer works at SmarterAsp.net, lost overview of what had changed and where.