I am trying to use the past special feature in vs 2012 in order to generate c# class for my Json data. I downloaded the Json.New from NewtonSoft from Nuget and then added a new .cs class the copied my json data to clipboard but when I go to Edit-> Paste Special --> I can only see: Paste XML As Classes only the Paste Json as Classes feature is not showing. Any Suggestions? Thanks you in advance
This is what I am getting and please note that I have installed Newtonsoft.Json already:
(source: indevcogroup.com)
To do so, select Edit > Paste Special and choose either Paste JSON As Classes or Paste XML As Classes.
I created a new project, installed Newtonsoft.Json and added a class.
If you have your class file open, copy your Json data and choose Edit -> Paste Special you will see both the options:
If you have some other kind of file open (e.g. app.config), you only see "Paste JSON as As Classes" (and it's greyed out)
It does seem a bit flaky though - sometimes I had to recopy the data before it would show up.
Try a) recopying your data b) playing around with what windows you've got open c) reinstalling the extension
When selecting the Edit > Paste Special menu while in the code of a class file, make sure that the Visual Studio project that your class file is under has its 'Target Framework' set to:
.NET Framework 3.5+ for 'Paste JSON as Classes'
.NET Framework 4.5+ for 'Paste XML as Classes'
Otherwise these options do not appear.
The 'Target Framework' setting is under the Project Properties > Application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With