Compiler construction Xamarin.iOS“;“正在尝试JIT编译方法”;简单类
我有一个Xamarin.iOS应用程序。我正在引用一个iOS库项目。在图书馆项目中,我有一个非常简单的类Compiler construction Xamarin.iOS“;“正在尝试JIT编译方法”;简单类,compiler-construction,xamarin.ios,jit,Compiler Construction,Xamarin.ios,Jit,我有一个Xamarin.iOS应用程序。我正在引用一个iOS库项目。在图书馆项目中,我有一个非常简单的类 using System; namespace Noodle.iOS { public class TestClass { string property; public TestClass (string property) { this.property = property; }
using System;
namespace Noodle.iOS
{
public class TestClass
{
string property;
public TestClass (string property)
{
this.property = property;
}
public string Property
{
get
{
return property;
}
}
}
}
当尝试在AppDelegate中实例化这个类时,我得到了以下错误
System.ExecutionEngineException: Attempting to JIT compile method 'Noodle.iOS.TestClass:.ctor (string)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information
我正在使用此代码在AppDelegate中实例化该类
var testClass = new Noodle.iOS.TestClass("test");
我参考了错误消息中提到的“限制”,但没有找到任何与我的设置相关的内容。我没有使用泛型/虚拟。我也在连接一切
你知道我为什么会犯这个错误吗?为什么MonoTouch(或mtouch.exe)不能编译我引用的iOS库项目
另一方面,是否有办法在iOS模拟器中禁用JIT,使其更像一台设备
更新
这似乎与我的另一个项目中的其他方法/类有关。似乎有一种用法导致整个库中断。如果不使用这个特定的静态类,我可以正确地使用整个库
Noodle.Engine.Singleton<Noodle.TinyIoCContainer>.Instance = new Noodle.TinyIoCContainer();
// var current = Noodle.EngineContext.Current;
Noodle.Engine.Singleton.Instance=new Noodle.TinyIoCContainer();
//var current=面条.EngineContext.current;
上面的代码有效。容器将被创建。但是,如果我取消对第二行的注释,第一行将不会给出这些仅限aot的错误
有什么想法吗?“Current”属性应该只返回在第一行创建的singleton实例
下面是github上的EngineContext.cs文件,用于帮助确定原因
这看起来很奇怪。我建议你创建一个完整的测试解决方案,可以用来复制它,因为你在这里展示的应该可以很好地工作。Rolf,我给支持人员(Michael James)发了一封电子邮件,其中有一个下载该项目的链接。谢谢