-
Notifications
You must be signed in to change notification settings - Fork 67
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
Relax our restrictions on Newtonsoft major versions #304
Comments
Both V1 and V2 should support JSON.NET >9.01 or JSON.NET > 11.0.2, not = |
I am running into issues trying to use newtonsoft 12.0.2. The runtime is loading 11, even when i explicitly pull 12 into my az functions 2.0 project. I am encountering an exception running JsonConvert.SerializeObject (which is fixed in v12.0.1) and can see the exception.TargetSite.Module is using 11. I can see both are loaded, but runtime version is being used for this invocation of JsonConvert. |
@fabiocav : Can you make a preview build and push it to nuget in order to validate your fix ? Current version still has a fixed version (.11). Thanks ! |
@nicholasdoyle can you please open a separate issue at https://github.com/Azure/azure-functions-host/issues with the details so that can be investigated? |
@fabiocav this existing issue can be used by @nicholasdoyle IMO. 🚀 🍰 |
🎉 |
@fabiocav Is this actually resolved? The linked pr is simply relaxes the library requirement, but that will cause horrible to diagnose runtime failures. |
@AartBluestoke you're correct that this pushes potential issues to happen at runtime, which is why the original restriction was in place to begin with. This didn't prevent the dependency from being added, so it was a small protection that was in place. We ended up making the change (after a lot of consideration and requests) as in the vast majority of cases, this shouldn't cause an issue, but because this could indeed cause problems that may be difficult to diagnose, we're making enhancements to the runtime to properly warn when this binding condition is hit and eventually also unify on 12 (for a few different reasons, primarily related to HTTP binding, there are some specific binding rules for Json.NET). Those changes will be tracked in the host repository, though. |
Background information to think on: https://codeblog.jonskeet.uk/2019/06/30/versioning-limitations-in-net/ |
Thanks, @DustinKingen. That’s a good post and covers much of what has been considered for this particular case. In the end, we do believe this change, coupled enhancements made to runtime binding, will improve the overall experience. |
I have a az function project I am trying to build in vs.net 2019 as soon as I include this namespace using Newtonsoft.Json.Serialization; and try to use it. I get a build error (below) Severity Code Description Project File Line Suppression State Error generating functions metadata |
Fabio, we have discussed this at Build. For V1, I would like you to make Azure Function to be compatible up to 11.02 of newtonsoft's JSON. I have way too many .net third party libraries that are simply not available for .net core. This is a Deal breaker as I have to resort to either cloud service or something else or different platform all together. |
@jwisener Thanks for pointing me in the direction to remove the using Newtonsoft.Json.Serialization; and try if that helps. And it does. This issue did cost me about 8 hours to figure out. |
Why this ticket is in closed status though the issue still persists even today ?? |
@ThiruA1980 that's only a warning, not the outright error that it was before the hard dependency was removed. At runtime, the 11.0.2 library will be the one physically present. That warning indicates that there is indeed a potential runtime error within your code if you use features from the not-loaded dll. |
A few people running into issues when they try to pull down a package that has Newtonsoft 12 requirements as a transitive dependency. While users can get around this today by explicitly pulling down a higher version of Newtonsoft 12 (which will be honored and work in v2 functions), it still leads to a bit of customer confusion. A potential option is to relax our restriction on Newtonsoft 11 so NuGet doesn't complain when this transitive dependency mismatch surfaces.
Related to Azure/azure-functions-host#4049
The text was updated successfully, but these errors were encountered: