You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Extension ships with a newer Newtonsoft.Json than Visual Studio 2017 #1774
The currently published extension ships with Json.NET version 10.0.x whereas VS ships built-in with 9.0.x. It's strongly advised that you do not ship newer versions of built-in VS assemblies, since that can cause incompatibilities or breakages in other packages.
The reason we're now doing this is that one of our dependencies uses 10.0. I can check whether that dependency is happy with 9.0, but if not, what is the recommended way of fixing this?
That's tricky. We had package load failures in some cases if we didn't distribute it, so we always make sure we distribute the same version as the VS we ship with :(
Do you know what is happening to cause the breakage? I can't immediately think of a scenario short of an extension calling Assembly.Load("Newtonsoft.Json") and assuming a particular version. I'd like to understand what's going on here.
I'm wondering if we should be using a [ProvideCodeBase] attribute for Newtonsoft.Json? We're now using ProvideBindingPath to make sure that our assemblies can be resolved (including from .imagemanifest, see #1236).
This will have the side effect of making our version of Newtonsoft.Json available via Assembly.Load("Newtonsoft.Json"). We could put it on a different path and explicitly specify its code base.
Activity
grokys commentedon Jul 10, 2018
The reason we're now doing this is that one of our dependencies uses 10.0. I can check whether that dependency is happy with 9.0, but if not, what is the recommended way of fixing this?
Downgrade Newtonsoft.Json to 9.0.1.
jcansdale commentedon Jul 11, 2018
@kzu 👋 should we treat
Newtonsoft.Jsonas a Visual Studio assembly and not package it at all?kzu commentedon Jul 11, 2018
That's tricky. We had package load failures in some cases if we didn't distribute it, so we always make sure we distribute the same version as the VS we ship with :(
kzu commentedon Jul 11, 2018
Also of interest: VS ships with binding redirects for this, currently:
So you can build against any older version, but not newer.
jcansdale commentedon Jul 12, 2018
@kzu,
It appears VS 2015 only knows about 4.5.0.0-6.0.0.0:
Do you know what is happening to cause the breakage? I can't immediately think of a scenario short of an extension calling
Assembly.Load("Newtonsoft.Json")and assuming a particular version. I'd like to understand what's going on here.I'm wondering if we should be using a
[ProvideCodeBase]attribute forNewtonsoft.Json? We're now usingProvideBindingPathto make sure that our assemblies can be resolved (including from.imagemanifest, see #1236).This will have the side effect of making our version of
Newtonsoft.Jsonavailable viaAssembly.Load("Newtonsoft.Json"). We could put it on a different path and explicitly specify its code base.Reference Newtonsoft.Json 9.0.1