Skip to content

NetJSON.Core incorrectly referenced to Xamarin Android project #146

Closed

Description

@binoypatel

Hi there,

I am trying to add NetJSON to Xamarin.Android project and found that it's adding reference of NetJSON.Core to the project which in-turn depends on Microsoft.Extensions.DependencyModel and resulting broken build.

If I reference NetJSON.dll from net40 folder manually, it works. Can you please fix this issue?

Thanks,
Binoy

Activity

  1. rpgmaker commented on Dec 23, 2016

    @rpgmaker
    Owner

    I would think in this case you might want to set the target framework for your project to something inline with .Net framework 4.x. nuget controls which framework is reference based on your project target, I don't think it will be possible for me to forcefully make it target correctly.

    If you can post your project settings or csproj file here, I might be able to dig deeper on why it is not working for you.

    Thanks,

  2. binoypatel commented on Dec 23, 2016

    @binoypatel
    Author

    Sure, here is my csproj file for Xamarin.Android:

    `


    Debug
    AnyCPU
    8.0.30703
    2.0
    {1A0EC261-1BAC-4DE2-8C65-12153F88FD68}
    {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
    Library
    Properties
    App1
    App1
    512
    true
    Resources\Resource.Designer.cs
    Off
    True
    v7.0
    Properties\AndroidManifest.xml


    true
    full
    false
    bin\Debug</OutputPath>
    DEBUG;TRACE
    prompt
    4
    True
    None


    pdbonly
    true
    true
    true
    bin\Release</OutputPath>
    TRACE
    prompt
    4
    False
    SdkOnly





    ..\packages\NetJSON.1.2.1.7\lib\netstandard1.6\NetJSON.Core.dll
    True



















    Designer











    `

    I have also attached sample project if you need in case.

    Thanks,
    Binoy
    App1.zip

  3. rpgmaker commented on Dec 24, 2016

    @rpgmaker
    Owner

    Could you share a screenshot of your nuget explorer when trying to add netjson. I want to see what it shows. Because based on this link below, it might just be that your project is trying to target the new .Net standard

    https://blog.xamarin.com/net-standard-library-support-for-xamarin/

  4. rpgmaker commented on Dec 26, 2016

    @rpgmaker
    Owner

    After much research, I cannot fix this issue. The best I can do is include the missing dependencies for it. Based on my finding when you reference nuget packages using the latest xamarin, it uses monoandroid60 for the target in packages.config file which points to .net standard. I tested the same thing with other package such as Newtonsoft.JSON and it does same thing also, it references .net standard packages rather than .net 4.x framework. I will be closing this issue since and will comment on the issue once I publish a new package(that includes .net standard missing dependencies) for the other issues i am working on.

    If you have any further comments or finding that might conflict what I just said, you may reopen the issue

  5. binoypatel commented on Dec 26, 2016

    @binoypatel
    Author

    Sorry for the late reply, the real problem is I cannot compile the xamarin.android project due to compilation error for Microsoft.Extensions.DependecyModel dependency:

    image

    Once this is fixed, it doesn't really a problem.

    Thanks,
    Binoy

  6. binoypatel commented on Dec 26, 2016

    @binoypatel
    Author

    Another issue is Microsoft.Extensions.DependencyModel depends on NewtonSoft.Json, it is redundant because NetJSON is intended to replace NetwonSoft.Json

    Thanks,
    Binoy

  7. added a commit that references this issue on Dec 26, 2016
  8. rpgmaker commented on Dec 26, 2016

    @rpgmaker
    Owner

    I have published a new version on nuget that contains the missing dependencies

  9. binoypatel commented on Dec 26, 2016

    @binoypatel
    Author

    Cool thanks for your prompt help, it worked with the newer version.

    Thank you very much
    Binoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions