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 }}
Repository navigation
NetJSON.Core incorrectly referenced to Xamarin Android project #146
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?
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.
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
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
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:
Another issue is Microsoft.Extensions.DependencyModel depends on NewtonSoft.Json, it is redundant because NetJSON is intended to replace NetwonSoft.Json
Activity
rpgmaker commentedon Dec 23, 2016
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,
binoypatel commentedon Dec 23, 2016
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
rpgmaker commentedon Dec 24, 2016
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/
rpgmaker commentedon Dec 26, 2016
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
binoypatel commentedon Dec 26, 2016
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:
Once this is fixed, it doesn't really a problem.
Thanks,
Binoy
binoypatel commentedon Dec 26, 2016
Another issue is Microsoft.Extensions.DependencyModel depends on NewtonSoft.Json, it is redundant because NetJSON is intended to replace NetwonSoft.Json
Thanks,
Binoy
- Fixed #142
rpgmaker commentedon Dec 26, 2016
I have published a new version on nuget that contains the missing dependencies
binoypatel commentedon Dec 26, 2016
Cool thanks for your prompt help, it worked with the newer version.
Thank you very much
Binoy