无法在 MonoDevelop 2.4.1 中添加 .NET 4.0 程序集引用

发布于 2024-10-08 05:30:32 字数 495 浏览 0 评论 0原文

我已经安装了 MonoDevelop 2.4.1 和 Mono 2.8.1。 我的问题是我无法将程序集引用添加到为 .NET 4.0 编译的程序集(在同一个 MonoDevelop IDE 上)。

我在做什么呢。参考文献->编辑参考文献-> .NET 程序集 ->浏览到文件&选择它

然后 MD 显示一个错误,指出我尝试添加的程序集不是 .NET 程序集。 我已将所有地方的配置文件设置为 .NET 4.0。

Reflector 可以很好地拆卸我的组件,所以没问题。 我的操作系统是 Windows 7 怎么了?

UPD: 向 Novell 发布了一个错误。这是https://bugzilla.novell.com/show_bug.cgi?id=659894< /a>

I've installed MonoDevelop 2.4.1 With Mono 2.8.1.
My trouble is that i can't add assembly reference to assembly compiled for .NET 4.0 (on same MonoDevelop IDE).

What am i do. References -> Edit References -> .NET Assembly -> Browse to file & select it

Than MD displays an error that an assembly that i'm trying to add isn't .NET assembly.
I've set profile to .NET 4.0 everywhere.

Reflector disassembles my assembly fine so it's ok.
My OS is Windows 7
What's wrong?

UPD:
Posted a bug to Novell. Here it is https://bugzilla.novell.com/show_bug.cgi?id=659894

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿咻 2024-10-15 05:30:32

当我执行 "C:\Program Files\Mono-2.8.1\bin\mono.exe" "C:\Program Files\MonoDevelop\bin\MonoDevelop.exe" 时,问题就消失了。

据了解,通过运行 MonoDevelop.exe,它可以在 Microsoft .NET 上运行,问题是 MonoDevelop(.NET 2.0 程序集)无法识别使用 2.0 API 的程序集(.NET 4.0)。

让我们看一下代码 (MonoDevelop.Ide.Projects.AssemblyReferencePanel):

private void SelectReferenceDialog(object sender, EventArgs e)
{
    string[] array = new string[this.chooser.Filenames.Length];
    this.chooser.Filenames.CopyTo(array, 0);
    foreach (string str in array)
    {
        bool flag = true;
        try
        {
            AssemblyName.GetAssemblyName(Path.GetFullPath(str));
        }
        catch
        {
            flag = false;
        }
        if (flag)
        {
            this.selectDialog.AddReference(new ProjectReference(ReferenceType.Assembly, str));
        }
        else
        {
            MessageService.ShowError(GettextCatalog.GetString("File '{0}' is not a valid .Net Assembly", str));
        }
    }
}

AssemblyName.GetAssemblyName(Path.GetFullPath(str)); 行是万恶之源。
我将向 Novell 发布错误报告。或者这不是一个错误?

When i do "C:\Program Files\Mono-2.8.1\bin\mono.exe" "C:\Program Files\MonoDevelop\bin\MonoDevelop.exe" the problem disapears.

It's understood that by running MonoDevelop.exe it runs on Microsoft .NET and the issue is that MonoDevelop (.NET 2.0 assembly) can't recognize an assembly (.NET 4.0) with use of 2.0 APIs.

Lets look at code (MonoDevelop.Ide.Projects.AssemblyReferencePanel):

private void SelectReferenceDialog(object sender, EventArgs e)
{
    string[] array = new string[this.chooser.Filenames.Length];
    this.chooser.Filenames.CopyTo(array, 0);
    foreach (string str in array)
    {
        bool flag = true;
        try
        {
            AssemblyName.GetAssemblyName(Path.GetFullPath(str));
        }
        catch
        {
            flag = false;
        }
        if (flag)
        {
            this.selectDialog.AddReference(new ProjectReference(ReferenceType.Assembly, str));
        }
        else
        {
            MessageService.ShowError(GettextCatalog.GetString("File '{0}' is not a valid .Net Assembly", str));
        }
    }
}

The line AssemblyName.GetAssemblyName(Path.GetFullPath(str)); is a source of all evil.
I'm going to post a bug report to novell. Or it's not a bug?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文