New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Azure .NET SDK with NewtonSoft.Json 9.0.2-beta results in SerializationBinder error #2552
Comments
It appears that downgrading Newtonsoft.Json to 9.0.1 from 9.0.2-beta resolves the issue |
@fuocor We're aware of this issue. It seems like a compatibility issue with the latest beta of JSON.NET, but we haven't been able to track it down yet. |
thanks |
@fuocor I'm having trouble getting a minimal repro of this problem. Would you be willing to share your code, or whatever minimal subset of it triggers the issue? Just calling |
I am getting the same error. Following this example: "dependencies": { |
Just downgrade to 9.1 of NewtonSoft to work around it Sent from my Windows 10 phone From: Larry Aultmanmailto:notifications@github.com I am getting the same error. Following this example: "dependencies": { You are receiving this because you were mentioned. |
DescriptionGet a minimal repro of the issue and determine the root cause. File issues for fix. Cost: 2 |
Thanks guys you save me a lot of time. |
Same here. The problem occurred when I added 2 fields to an index. I was on NewtonSoft.Json 10, a downgrade to 9 made it work again. Probably it works when updating to NewtonSoft.Json 10 if the index is untouched. Changing the index causes the problem. |
@bottomup Note that this issue covers all Azure .NET libraries. It sounds like you're talking about the Azure Search library in particular -- is that correct? If so, which version are you using? |
@brjohnstmsft correct. I'm using Microsoft.Azure.Search 3.0.3. |
@bottomup Can you try upgrading to 3.0.4 and let me know if you still experience the problem? |
I'm having the same issue with Azure Search. Upgraded to 3.0.4 and I get the error "Cannot get SerializationBinder because an ISerializationBinder was previously set.". Using Newtonsoft.Json version 10.0.2. |
Its important to note that this is not a particular nuget issue... Any nuget from Azure SDK that is using 9.0.1 and you try to use 10.x.x+, you will get that problem... |
Thanks for the info. So do we need to wait until a new version comes out that uses 10.x.x+ ? I can't downgrade to 9. |
Yeah, unfortunately... I did rollback to 9+ for a particular project that use those packages in order to be unblocked... |
I tried adding the following binding redirect, but it didn't work:
@markcowl Any idea when a new version will be released which supports NewtonSoft.Json v10? |
@brjohnstmsft I tried your suggestion and upgraded to 3.0.4, but the same issue arises. Downgraded again to NewtonSoft.Json 9.0.1 |
Just adding to this - I see this, but only when I generate an invalid search query in the Azure Search SDK - then it comes back with this error (rather than the "real" error). |
This is an issue in ClientRuntime.Azure and will be fixed shortly. |
@hovsepm Thanks Hovsep. The Azure Search SDK does some custom JSON serialization stuff as well, so once the issue in ClientRuntime.Azure is fixed, I still have to verify whether more work needs to be done to fix the issue in Microsoft.Azure.Search. |
We misunderstood the root cause for this, which is why we had the additional delay. Hovsep's fix will allow those using NetCore and those using binding redirects in net452 to use Newtonsoft.Json. Those who cannot use binding redirects will need us to republish the individual management libraries, which will happen next month. @brjohnstmsft Code the depends on ClientRuntime exception handling should be fixed automatically with an upgrade. Code that directly uses properties deprecated in Version 10 will have to be updated. |
@galvesribeiro Those libraries are compatible with the new runtime, so you should be able to upgrade. Note that you will need to be using NetCore or assembly binding redirects to take this fix, because the assembly identity for Newtonsoft.Json has changed. |
@markcowl thankfuly I'm free from binding redirect hell by using .Net Core :) Thanks! Looking forward for the update. |
The issue is resolved. Please use Microsoft.Rest.ClientRuntime.Azure v 3.3.8 or later. |
@hovsepm @markcowl Not sure this should be closed until the libraries depending on |
@shahabhijeet should also have an idea when that could happen. |
@hovsepm No, but the minimum required version is 3.3.6, not 3.3.8. A few of our customers have already reported running into this issue as soon as they upgrade to JSON.NET 10. Referencing 3.3.8 resolves it, but in the meantime it creates extra support traffic for us. |
@brjohnstmsft following [fix] (JamesNK/Newtonsoft.Json#1341) fixes underlying error. New set of Clientruntime libraries are on track to be republished by next week. |
@shahabhijeet Awesome, thanks for the update! |
I am getting a TargetInvocationException on an index with the innerExcpetion of "Cannot get SerializationBinder because an ISerializationBinder was previously set." from Newtonsoft.Json.
The code is pretty straight forward:
Any help is appreciated
rich
PS - I'm using Windows.Azure.Search (2.0.6-preview)
The text was updated successfully, but these errors were encountered: