我正在使用最新版本的 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/