I Installed the Nuget Package Installer thing, and it says it installed it.
However I can't find any references to JSON in Visual Studio.
I tried using System.JSON but I can't find it.
How can I use it?
Thanks
I have had been through the same trouble today, when I almost completed my Software Project and just had to use the File to use its contents to change the content of the Project.
For that I wanted to use JsonObject class to get the contents of the .json file. When I tried to write this
using System.Json;
It gave me the exact same error that you might have been going through. It asked for the Assembly files and DLLs.
I kept searching and I stumbled upon to this post, which was totally unhelpfull for me. So I searched and got what I was looking for. After that, I wanted to share that triumph with you people too so that next visitor must have an answer to his trouble on Stack Overflow.
Solution
What I did was, I went to the NuGet website for the System.Json extension package.
http://www.nuget.org/packages/System.Json
There, I capture the command for the installation.
I just click on the Tools --> NuGet package manager --> Package Manager Console and it gave me a new window in the bottom part of Visual Studio 2013.
There I typed (pasted) the link of command I copied. It started and installed the package for me. And now I can use it!
Further answer
I was told that it is a part of .NET v4.5, but I even have the v4.5.1 and still I don't get it why I don't have that package, maybe because on the Web page of the package it is shown deprecated. But still who ever needs it, can have the answer I have posted and it would help him out!
Good luck!
I think you can use the Newtonsoft JSON.NET package.
http://www.nuget.org/packages/newtonsoft.json/
I was also looking for a way to do JSON in C# and saw that they made it easier with .NET 4.5, couldn't do it and found this stack overflow question. I wasn't really satisfied with Afzaal Ahmad Zeeshan's answer so I kept searching and found this which I guess isn't depreciated and worked for me.
Steps in plain English (for .NET 4.5):
1.Add Reference to System.Runtime.Serialization
2.Add "using System.Runtime.Serialization.Json;" to your class
3.call "JsonReaderWriterFactory.CreateJsonReader()" or whatever methods you need to use to read/write json
Install latest VS 2017
Install-Package System.Runtime.Serialization.Json -Version 4.3.0
-- in PM console
Related
I am novice in VBA, but I never thought I will have a problem like that anyway. Well, the problem is next.
I need to parse json from api in my VBA app. I am trying to use VBA-JSON library (https://github.com/VBA-tools/VBA-JSON), cause I failed to find somewhere any other suitable solution for this task. The reason I have to write here about this, is that there are billions of guides how to install this library if you use Visual Basic in Excel, but no information how to do it if you use Visual Studio.
When following instructions I am trying to import this "JsonConverter.bas" into my project, I can do this, but it is not recognized correctly, as I can see.
Errors
There is written, that:
"Add Dictionary reference/class
For Windows-only, include a reference to "Microsoft Scripting Runtime"", and I added it in references.
Reference is added
Of course I get build errors when I am trying to run application.
So, could somebody tell me please, where is my mistake, and how to install this library?
Thank you in advance.
I'm creating script tasks in SSIS packages using the free BIMLExpress. Since we have different versions of .NET Framework installed in our environment I really need to be able to set the Framework version for the script project. Although I know how to change it manually, it would be very difficult to change it manually.
I have already tried looking for a solution and this answer suggests to use TargetFrameworkVersion property but I don't see that property at all, I've tried using it with no effect. I don't know if it only works with BimlStudio the paid version.
I'm using BIMLExpress 5.0.61915.0 with Visual Studio 2015.
Any help is greatly appreciated.
Thanks
I opened the generated .dtsx package and found that the TargetFrameworkVersion node placed inside of a separate PropertyGroup node. After I had moved it out to the first PropertyGroup of the same arrayElement node, then reopened my package in Visual Studio again, issue was gone! So you can write a script to move TargetFrameworkVersion node into the proper place for now.
Varigence support team told me that a public preview release is coming late next week which will include a fix for that.
I've been developing UWP app until I got this error (picture below). I've searched for solution but I couldn't find anything. It doesn't even say which package is the incompatible. How can I find the incompatible package in my solution? Also is there any way to re-create project.json by automatically? I ask it because I changed something on project.json and broke it more.
Also I'm using VS2017 and I'm able to run project without issue. I just can't update package.
Thanks.
(github link for project if you want to look at it.)
I used your GitHub https://github.com/almorax/dota2-handbook-uwp project to troubleshoot the problem and looks like the problem is with the way the nuget package is referred in "Dota2Handbook" project. In other projects, you have used "PackageReference" way to refer the nuget package however in "Dota2Handbook" project you are using project.json to refer nuget package. When I changed "Dota2Handbook" project to use the "PackageReference" way then I was able to get the latest package.
Note: You will notice that "Dota2Handbook.Infrastructure" project already use the new way to refer Nuget packages
More details on PackageReference : https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files
What happened to me is that I have UWP projects that were made in VS 2015 and initially targeting Windows 10 RTM. These projects where updated to VS 2017 and to target Creator's Update. All worked fine, and all projects still used the original project.json style.
Then I tried to create a new Windows Runtime Component project and target Creator's Update initially. Targeting Creator's Update in VS 2017 causes the project to use the new PackageReferences project style. This produced the errors shown in the above question when I referenced the WinRT component from the UWP app.
Rather than converting the all of my legacy UWP project files to use the new format, I target the new UWP or WinRT Component library to Anniversary Edition (which uses the older project.json project style), then retarget to Creator's Update.
Of course, at some point updating the project file may be appropriate, just know that it will no longer be supported by VS 2015. Conversion steps are illustrated here.
I'm using Qt4.7 on a Windows machine. I can't update Qt to version 5 and I'm unable to install CMake.
I need to use QJSon for a project, but it seems to be only available natively on Qt5+. Can anyone instruct me on how to "backport" it or something?
I also found this class for JSON handling that might serve the same purpose. If I wanted to use it instead, do I only need to import it to my project?
Please escuse me if this is all too simple/evident, but I'm new to desktop development, I only have some experience with webdesign, so any help is welcome. :)
Whilst you could attempt to backport QJson you're best off going for the second option, simply for ease. All you need to do is bring the files into your project, if you're using Qt Creator when you do 'Add existing...' it should automatically add the include and header to the compilation phase. If it doesn't you add them to the .pro file so the compiler knows what it needs to include.
I have only just started experimenting with MonoDroid and this is my first time using Mono and MonoDevelop. I wanted to do some Json stuff and added a reference to ServiceStack.Text library. However, the namespaces in the newly added assembly references are not available in the intellisense until I restart MonoDevelop. Has anyone else encountered this? I can't quite tell if this is a MonoDevelop issue or something more specific to the MonoDroid/MonoDevelop combination.
I think it is related to Mono for Android somehow. I tired recreating your test case, which seemed as you described with a Mono for Android project. Creating a similar project just for MonoTouch, it loads the IntelliSense immediately not having to restart MonoDevelop. I suggest you file a bug in their BugZilla: https://bugzilla.xamarin.com/index.cgi