我想使用.NET的System.Web.Script.Serialization.JavaScriptSerializer
在MacOS上使用MonoDevelop将JSON文件读入Unity中的Dictionary。不能在MacOS上的Unity和MonoDevelop中使用.NET的JavaScriptSerializer
到目前为止,我已将System.Web.Extensions
程序集添加到MonoDevelop中,这使得它可以构建“Assembly-CSharp”项目。
但是当我回到Unity时,它仍然显示错误:错误CS0234:命名空间System中不存在类型或名称空间名称Web。您是否缺少装配参考?
然后我说添加DLL的任何地方注入资产的文件夹会做在网络上阅读,所以我找到了MonoDevelop中的路径里面的文件System.Web.Extensions.dll
的一些版本,它们在:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/gac/System.Web.Extensions
有3个文件夹与不同版本的文件:1.0.61025.0__31bf3856ad364e35
,3.5.0.0__31bf3856ad364e35
和4.0.0.0__31bf3856ad364e35
试过所有的人,但没有工作,团结给出了这样的错误:
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
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.TypeManager.CoreLookupType (Mono.CSharp.CompilerContext ctx, System.String ns_name, System.String name, Kind type_kind, Boolean required) [0x00000] in <filename unknown>:0
at Mono.CSharp.TypeManager.InitCoreTypes (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile() [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
那么,现在呢?
志愿者将本程序集加入开源的Mono项目? – bmargulies
当然,我该怎么做? – Petruza
Unity标签用于Microsoft Unity。请不要滥用它。 –