UWP with Castle.Core:使用.NET本机工具链编译错误

UWP with Castle.Core:使用.NET本机工具链编译错误,uwp,castle-dynamicproxy,.net-native,Uwp,Castle Dynamicproxy,.net Native,在我们的UWP应用程序中,当在.NET本机工具链激活的情况下构建应用程序时,我们得到以下错误: Exception thrown: 'System.Exception' in Castle.Core.dll An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code Method 'TypeBuilder.AddInterfaceImplementatio

在我们的UWP应用程序中,当在.NET本机工具链激活的情况下构建应用程序时,我们得到以下错误:

Exception thrown: 'System.Exception' in Castle.Core.dll
An exception of type 'System.Exception' occurred in Castle.Core.dll but was not handled in user code
Method 'TypeBuilder.AddInterfaceImplementation(Type)' was not included in compilation, but was referenced in ClassEmitter..ctor(ModuleScope, string, Type, IEnumerable<Type>, TypeAttributes, bool). There may have been a missing assembly.
在Castle.Core.dll中引发异常:“System.Exception”
Castle.Core.dll中发生“System.exception”类型的异常,但未在用户代码中处理
方法“TypeBuilder.AddInterfaceImplementation(Type)”未包含在编译中,但在ClassEmitter..ctor(ModuleScope、string、Type、IEnumerable、TypeAttributes、bool)中被引用。可能缺少一个程序集。
我们的Default.rd.xml如下所示:

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <!--
      An Assembly element with Name="*Application*" applies to all assemblies in
      the application package. The asterisks are not wildcards.
    -->
    <Assembly Name="*Application*" Dynamic="Required All" />
  </Application>
</Directives>

我不知道我必须向Default.rd.xml添加什么才能使我的应用程序在.NET本机工具链激活的情况下也能工作

我们在UWP应用程序的Autofac IOC中使用Castle.Core进行方法拦截

谢谢你的帮助,
Peter

UWP不支持
System.Reflection.Emit
。它有时可能在调试中工作,但在带有.NET本机编译的版本中不工作:


System.Reflection.Emit
NuGet软件包(暂时)退市后,我们(Castle)考虑DynamicProxy是否应该直接针对.NET Framework和.NET Core,而不是针对.NET标准,但是.NET团队最近正式将Emit API添加到.NET标准中,以前它是在.NET标准API中意外出现的。

UWP不支持
System.Reflection.Emit
。它有时可能在调试中工作,但在带有.NET本机编译的版本中不工作:


System.Reflection.Emit
NuGet软件包(暂时)退市后,我们(Castle)考虑DynamicProxy是否应该直接针对.NET Framework和.NET Core,而不是针对.NET标准,但是.NET团队最近正式将Emit API添加到.NET标准中,以前,它是在.NET标准API中偶然出现的。

虽然这是一个合法的问题,但对于如此专业的解决方案,您很难得到答案,请尝试直接询问提供商。虽然这是一个合法的问题,但对于如此专业的解决方案,您很难得到答案,请尝试直接询问提供商。好的,谢谢您的回答。所以基本上这意味着,我们目前不能使用Castle.Core与我们的UWP项目,对吗?这是我的理解,不幸的是。好的,谢谢你的回答。所以基本上这意味着,我们目前不能在我们的UWP项目中使用Castle.Core,对吗?不幸的是,这是我的理解。