错误:Unhandled Exception: System.TypeLoadException:Could not load type 'Newtonsoft.Json.Linq.JContaine
json
适用于现代 C++ 的 JSON。
项目地址:https://gitcode.com/gh_mirrors/js/json
免费下载资源
·
使用 Newtonsoft.Json的时候 vs 编译出现错误:
Severity Code Description Project File LineError Unhandled Exception: System.TypeLoadException: Could not load type 'Newtonsoft.Json.Linq.JContainer' from assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)
at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) [0x00000] in <filename unknown>:0
at System.Reflection.Assembly.GetType (System.String name) [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.GetTypeInAssembly (System.Reflection.Assembly assembly, System.String name) [0x00000] in <filename unknown>:0
at Mono.CSharp.RootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in <filename unknown>:0
at Mono.CSharp.GlobalRootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in <filename unknown>:0
at Mono.CSharp.Namespace.LookupType (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in <filename unknown>:0
at Mono.CSharp.Namespace.Lookup (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in <filename unknown>:0
at Mono.CSharp.NamespaceEntry.Lookup (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.NamespaceEntry.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.DeclSpace.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.DeclSpace.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.MemberCore.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.Method.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.ResolveContext.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0
at Mono.CSharp.SimpleName.ResolveAsTypeStep (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.ResolveAsBaseTerminal (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.ResolveAsTypeTerminal (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0
at Mono.CSharp.Expression.ResolveAsContextualType (IMemberContext rc, Boolean silent) [0x00000] in <filename unknown>:0
at Mono.CSharp.LocalInfo.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.ToplevelBlock.ResolveMeta (Mono.CSharp.BlockContext ec, Mono.CSharp.ParametersCompiled ip) [0x00000] in <filename unknown>:0
at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0
Internal compiler error at Assets/Scripts/VideoList.cs(60,17):: exception caught while emitting MethodBuilder [VideoList::load3dVideos]
The class System.ComponentModel.AddingNewEventHandler could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
The class Newtonsoft.Json.Linq.JContainer could not be loaded, used in Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed Solution 'Test1' (1 project) 0
因为 Mono 平台支持 .net 3.5,所以只能使用 NET20 的 newtonsoft.json.dll导致了此问题。
解决办法:
Unity 菜单 Edit->Project Settings->Player, 在 Player 设置里选择 Api Comatibility Level 从 .NET 2.0 Subset 改为 .NET 2.0。
GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e
3 个月前
8c391e04
6 个月前
更多推荐
已为社区贡献3条内容
所有评论(0)