Skip to content
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

Error adding reference to PCL #10

Closed
HappyNomad opened this issue Jan 15, 2017 · 6 comments
Closed

Error adding reference to PCL #10

HappyNomad opened this issue Jan 15, 2017 · 6 comments

Comments

@HappyNomad
Copy link

The following error prevented me from adding the library to my portable class library (PCL).

Could not install package Marvin.JsonPatch.Dynamic 1.0.0. You are trying to install this package into a project that targets .NETPortable,Version=v4.5,Profile=Profile7, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I was able to add Marvin.JsonPatch to the same PCL.

@KevinDockx
Copy link
Owner

KevinDockx commented Jan 18, 2017

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/

@HappyNomad
Copy link
Author

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.

@KevinDockx
Copy link
Owner

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.

@chriscoderdr
Copy link

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 ?

@HappyNomad
Copy link
Author

HappyNomad commented Jul 1, 2017

@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.

@KevinDockx
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants