【问题标题】:getting error when making a plugin in Unity for Windows Phone 8在 Unity for Windows Phone 8 中制作插件时出错
【发布时间】:2014-06-10 11:22:17
【问题描述】:

我正在尝试为 windows phone 8 统一制作插件。但是在尝试移植实际设备时出现以下错误。

Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 

  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Driver.LoadReferences () [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 

这是我的 dll 文件的代码

namespace Plugin
{
    public class PhoneActivity
    {
        public static string getOperatorName
        {
            get
            {
                string networkOperatorName = DeviceNetworkInformation.CellularMobileOperator;
                return networkOperatorName;
            }
        }

        public static void makeCall(string Name, string phoneNumber)
        {

            PhoneCallTask pct = new PhoneCallTask();
            pct.DisplayName = Name;
            pct.PhoneNumber = phoneNumber;
            pct.Show();
        }

    }
}

我在 ARM 模式下进行了调试。我使用 File-> New Project-> Windows Phone Class Library 来创建项目。

我在互联网和 stackoverflow.com 上搜索,我发现了这个主题的主题,但解决方案对我不起作用。

您的帮助将不胜感激。

【问题讨论】:

    标签: c# windows-phone-8 plugins unity3d


    【解决方案1】:

    在挣扎了 2 天后,我终于找到了解决方案。教程中的解决方案自行解决。您应该使用 Plugins Assets 文件夹下的文件夹。这应该像这个 Assets/Plugins/WP8/custom.dll 文件。文件夹名称和顺序很重要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多