c# - IKVM 和 System.Core System.Runtime.CompilerServices.ExtensionAttribute

标签 c# .net extension-methods ikvm build-error

我正在使用最新版本的 IKVM 将 Java .jar 文件“编译”为 .NET DLL。一切正常,现在我尝试在 .NET 3.5 C# 项目中引用 DLL。

在我的 C# 项目中,我创建了一个静态“StringExtensions”类,其中包含字符串扩展方法。

出于某种原因,这似乎昨天有效,但今天,我的扩展类上出现构建错误(不确定昨天它是如何工作的......)。

Missing compiler required member System.Runtime.CompilerServices.ExtensionAttribute..ctor

还有构建警告:

The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\TEMP\IKVM.Runtime.dll'

我发现 IKVM.Runtime.dll 和 System.Core.dll(3.5 版本)具有相同的类型:“System.Runtime.CompilerServices.ExtensionAttribute”

由于命名空间相同,我如何才能使用 ExtensionAttribute 的 System.Core 版本进行编译(或者如何修复此问题)?

谢谢

最佳答案

更新到 IKVM 0.40.0.1 解决了我的这个问题。

关于c# - IKVM 和 System.Core System.Runtime.CompilerServices.ExtensionAttribute,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/682244/

相关文章:

.net - 使用网络摄像头在WP7仿真器中模拟手机摄像头

c# - 如何使用扩展方法加入 .NET Entity Framework 中的多个列?

c# - C# .NET 的区间数据类型?

c# - 如何以 JSON 格式传递 TimeSpan 值?

.net - 什么时候需要适用于 MSBuild 的 Windows SDK?

c# - 将标志转换为 IEnumerable<Enum> 的扩展方法,反之 (C#)

c# - 是否可以为控制台编写扩展方法?

c# - 将 Checkbox.Checked 属性绑定(bind)到 DataSet 上的属性

c# - 将 Windows 主题更改为高对比度时,将按钮颜色更改为白色

.net - 你怎么称呼这些? [数组][字符串][整数]