如何展现和QUOT;粘贴的Json类"在Visual Studio 2012点击时选择性粘贴? [英] How to show the "paste Json class" in visual studio 2012 when clicking on Paste Special?

查看:504
本文介绍了如何展现和QUOT;粘贴的Json类"在Visual Studio 2012点击时选择性粘贴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用过去的特殊功能在VS 2012,以生成C#类我的JSON数据。
我是从的NuGet下载的Json.New从NewtonSoft,然后添加一个新的.cs类的复制我的JSON数据到剪贴板,但是当我去编辑 - >选择性粘贴 - >我只能看到:粘贴XML作为类只粘贴JSON作为类功能没有显示。有什么建议么?
感谢您提前

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

这是我收到,请注意,我已经安装了Newtonsoft.Json早已:

This is what I am getting and please note that I have installed Newtonsoft.Json already:

推荐答案

我创建了一个新的项目,安装Newtonsoft.Json并增加了一个类。

I created a new project, installed Newtonsoft.Json and added a class.

如果你有你的类文件打开,复制您的JSON数据,然后选择编辑 - >选择性粘贴,你会看到两个选项:

If you have your class file open, copy your Json data and choose Edit -> Paste Special you will see both the options:

如果你有一些其他类型的文件打开(例如app.config)中,你只看到粘贴JSON作为作为类(和它的灰色)

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.

尝试)重新复制您的数据b)同你有什么窗户打开C)重新安装扩展玩耍

Try a) recopying your data b) playing around with what windows you've got open c) reinstalling the extension

这篇关于如何展现和QUOT;粘贴的Json类"在Visual Studio 2012点击时选择性粘贴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆