Closed HappyNomad closed 7 years ago
Hi,
this package is not meant to be added to a PCL project. It requires refs from full .NET, and is thus meant to be used at server level and/or for full .NET clients only. However, it can be used at server level with a client that uses Marvin.JsonPatch in PCL. That's the advised way: at server level (API), use Marvin.JsonPatch.Dynamic (or the .NET core version if you're using .NET core). At client level, use whatever fits the framework you're using. Have a look at this for more info: https://www.kevindockx.com/which-jsonpatch-flavour-should-i-use/
I need to use the non-generic JsonPatchDocument
class on the client-side (not full .NET) for nested objects. Nested objects are only supported by this non-generic, which is fine since I don't have the object type as a type parameter so need this version anyway.
For what does Marvin.JsonPatch.Dynamic
require references from full .NET? If it's related to supporting dynamically typed objects, I have no need for this functionality. For my scenario, whatever pieces depend on full .NET can remain in the non-PCL Marvin.JsonPatch.Dynamic
while the rest of the non-generic JsonPatchDocument
class should move to the Marvin.JsonPatch
PCL.
Please don't arbitrarily limit usage of the non-generic JsonPatchDocument
. That may be fine in your scenarios, but it's not okay in general as I can see in my scenario.
That would mean a change in JsonPatch, not in JsonPatch.Dynamic - this one is indeed aimed at dynamically typed objects. I added an issue on the JsonPatch issue list.
So I have my pcl with targeting .net standard 1.4 and have the same problem, how did you manage to fix the issue @HappyNomad ?
@cgomezmendez Microsoft's JSON Patch library targets .NET Standard 1.4, so you can reference it. I had a Windows 8.1 app which can only reference .NET Standard 1.2. I tried @KevinDockx's version but ran into this issue. The writing is on the wall so I ported my app to UWP. Now all my libraries target .NET Standard 1.4. I now use Microsoft's, instead of @KevinDockx's, library and so don't have to deal with this issue.
As @HappyNomad mentions: when targeting .NET Standard, it's best to use Microsoft.AspNetCore.JsonPatch. That's a port of this library, for .NET Core. Closing this issue.
The following error prevented me from adding the library to my portable class library (PCL).
I was able to add
Marvin.JsonPatch
to the same PCL.