【发布时间】:2018-11-23 12:59:17
【问题描述】:
在全新安装 Unity3D (2018.1.1f1) 后,它安装了 VS 2017 (15.7.3)。 我开始了一个cs脚本,并且想调试一个对象“print_r”样式,所以我通过nuGet Package-Manager安装了Newtonsoft.Json 11.0.2。 如果我在 pakage-console 中调用“Get-Package”,它会显示给我
Newtonsoft.Json {11.0.2} Assembly-CSharp
不幸的是,当我尝试编译时它仍然向我推送错误:
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler CS0246 Der Typ- oder Namespacename "Newtonsoft" wurde nicht gefunden (möglicherweise fehlt eine using-Direktive oder ein Assemblyverweis)。组装-CSharp C:\Users\bubu\Documents\Therapiefilm\Assets\test.cs 4 Aktiv 这意味着未找到命名空间“Newtonsoft”或缺少组装链接。
但我不知道错误实际上是什么。 ;-(
欢迎任何提示! 问候 雷内' ps:我的脚本来源:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
public class test : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
private static void Dump(object o)
{
string json = JsonConvert.SerializeObject(o, Formatting.Indented);
Console.WriteLine(json);
}
}
【问题讨论】:
-
在项目上试用 RMB 并恢复 NuGet 包。
标签: c# json unity3d namespaces json.net