zoukankan      html  css  js  c++  java
  • unity中导入插件时报错处理办法

    错误如下:

    Unhandled Exception: System.TypeLoadException: Could not load type 'System.ComponentModel.InitializationEventAttribute' from assembly 'System.Windows.Forms'.

    at (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool)

    at System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0

    at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0

    at System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0

    at Mono.CSharp.AttributeTester.GetObsoleteAttribute (System.Type type) [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.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/VLC for Unity/Scripts/PlayVLC.cs(241,21):: exception caught while emitting MethodBuilder [PlayVLC::GetCurrentMonitorDesktopResolution]
    The class System.Runtime.InteropServices.StandardOleMarshalObject could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    The class System.Windows.Forms.Control could not be loaded, used in System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicK

    因为 Mono 平台支持 .net 3.5,所以只能使用 NET2.0 的 newtonsoft.json.dll导致了此问题。

    解决办法:

    Unity 菜单 Edit->Project Settings->Player, 在 Player 设置里选择 Api Comatibility Level 从 .NET 2.0 Subset 改为 .NET 2.0。

  • 相关阅读:
    Codeforces Round #630 (Div. 2) E. Height All the Same(组合数学 快速幂 逆元)
    Codeforces Round #627 (Div. 3) F. Maximum White Subtree(树型dp 换根法)
    Codeforces Round #630 (Div. 2) F. Independent Set (树型dp)
    权值线段树 简单总结 相关例题
    Codeforces Round #631 (Div. 2) D. Dreamoon Likes Sequences (bitmasks +dp )
    2018,奔波与意义
    geopandas overlay 函数报错问题解决方案
    使用Python实现子区域数据分类统计
    我要做数据分析
    geotrellis使用(四十二)将 Shp 文件转为 GeoJson
  • 原文地址:https://www.cnblogs.com/Study088/p/7543279.html
Copyright © 2011-2022 走看看