- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在为 .NET 的自定义语言开发编译器,它目前使用 System.Reflection.Emit 但是当我想在 Mono 上运行它时(它在 MS .NET 上运行良好,2.0 和 4.0 CLR ) 我在处理 GenericTypeParameterBuilder 时遇到了一堆异常,最具体的是这个:
Unhandled Exception: System.NotSupportedException: The invoked member is not supported in a dynamic module.
at System.Reflection.Emit.TypeBuilder.check_created () [0x00012] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection.Emit\TypeBuilder.cs:1678
at System.Reflection.Emit.TypeBuilder.InternalResolve () [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection.Emit\TypeBuilder.cs:1653
at System.Reflection.Emit.GenericTypeParameterBuilder.InternalResolve () [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection.Emit\GenericTypeParameterBuilder.cs:93
at System.Reflection.MonoGenericClass.InternalResolve () [0x00021] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection\MonoGenericClass.cs:105
at System.Reflection.Emit.TypeBuilder.DefineDefaultConstructor (MethodAttributes attributes) [0x00030] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection.Emit\TypeBuilder.cs:484
at System.Reflection.Emit.TypeBuilder.CreateType () [0x0017f] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.9\mcs\class\corlib\System.Reflection.Emit\TypeBuilder.cs:788
at dotC.CType.CreateType () [0x00000] in <filename unknown>:0
at dotC.Compiler.Save () [0x00000] in <filename unknown>:0
at dotC.Compiler.Compile () [0x00000] in <filename unknown>:0
at dotC.Dev.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
现在运行它的代码非常复杂,因此很难复制粘贴一段特定的代码,但我尝试编译的代码结构如下所示:
public class Foo<T> { }
public class Bar<T> : Foo<T> { }
问题发生在我试图编译应该从 Foo
所以我的问题是:这是 Mono SRE 中的已知问题吗?有没有办法解决这个问题?它是否已在新的单声道测试版或其他软件中修复?
最佳答案
这看起来确实像一个错误。似乎在设置父类型之前显式调用子类型的类型构建器上的 DefineDefaultConstructor
并调用 CreateType
将解决它,至少在最简单的情况下是这样。
编辑
或者,为子类型显式定义一个构造函数(它可能只调用基本构造函数并返回)看起来即使在设置父类型之后也能正常工作,所以这可能是更好的方法。
关于c# - 不一致的 Reflection.Emit 支持 Mono?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14712399/
我只是偶然发现了一个似乎广为人知的compsci关键字“emit”。但是我找不到用通用计算机科学术语对其的任何明确定义,也找不到任何特定编程语言中的“emit()”函数或关键字的特定定义。 我在这里找
在 Qt 中,它们都是有效的,并且表现相同: emit someSignal(value); 对比 emit(someSignal(value)); 有什么区别吗? 最佳答案 Is there any
是否可以同步执行并在调用方法本身时返回结果。所以,我想在 $emit 完成后执行下一条语句。其如下: Parent component has method, doC
我是 socket.io 的新手,遇到了一些看起来很奇怪的事情。我实际上不知道 socket.emit 和 io.emit 之间的区别,但我在任何地方都找不到解释。 io.on('connection
有谁知道如何显式实现接口(interface)的属性 使用反射。发射? 最佳答案 有关 TypeBuilder.DefineMethodOverride 的信息,请参阅 MSDN 文档,其中包括使用
我有多个可观察对象进行网络调用,并且仅当所有可观察对象发出错误时,我才需要从组合器可观察对象发出错误。如果至少有一个可观察完成,则应传递结果。 我当前的流功能如下: Observable.fromIt
我想在这里实现的是当 IF 语句为 true 时 fightID 更改为其他值,因此它不会匹配它之前分配的值,因此我无法在战斗结束后立即通过控制台运行 win-fight 发出的消息。但是我现在得到的
当我们需要自定义组件在 VueTable2 中发出事件时,我们必须使用: this.$parent.$emit('myCustomEvent') // instead of this.$emit('m
This is my production webpack config .标题中的两个引号分别指的是 webpack2 和 webpack。两者都因类似的错误而挂起。 这是我触发构建的命令 设置 N
我正在尝试构建一个发布者,它会在其他 5 个发布者中的任何一个发布者发出 true 时发出 true。我已经设法构建了一个工作版本,但感觉非常恶心,使用 CombineLatest4 + Combin
我正在尝试创建用于教育目的的简单 .net 编译器。在解析、扫描和构建 AST 之后,我正在使用 Reflection.Emit.ILGenerator 生成 .net 程序集。 这是我的程序集生成示
以下 node.js 脚本不工作 var EventEmitter = require('events').EventEmitter; var util = require('util'); var
我使用的是Laravel 10,Livewire 2.x,我试图使用Livewire组件中的一个简单函数中的emit或emitTo事件来更新愿望列表计数。。WishlistCount控制器:。当我运行
我收到以下警告: [Vue warn]: Extraneous non-emits event listeners (addData) were passed to component but cou
我不明白 io.emit 和 io.sockets.emit 之间有什么区别。 有时它们的行为相同,但有时它们的行为不同。 最佳答案 socket.emit 仅将消息发送到发送者客户端 io.emit
我刚刚成功地使用 socket.io 连接到一个服务器脚本,所以我很高兴。我对我的脚本生成的奇怪行为不太满意:我在单击按钮时向服务器脚本发送一个发射,然后服务器测试脚本向控制台日志发回一条消息 6x。
这听起来可能有点模糊,但我仍在学习并试图理解它是如何工作的。 我开始使用“侧菜单”启动 ionic 项目,它已经设置了带有“应用程序”抽象状态/ View / Controller 的 urlrout
我遵循了一些 Nodejs 教程并完成了一个简单的 REST Web 服务。此 Web 服务监听/api/accounts 中的电子邮件和密码,然后继续在 Cassandra 集群中进行查找。我使用
我正在尝试建立一种模式,在这种模式下,我的产生某些对象的可观察对象被转换为领域事件,例如围绕可观察对象产生的 Started、Success、Error,如果这有意义的话 public Observa
这个问题已经有答案了: How can I let the javascript catch a signal from node and prompt a window right after th
我是一名优秀的程序员,十分优秀!