无法在 MonoDevelop 2.4.1 中添加 .NET 4.0 程序集参考 [英] Can't add .NET 4.0 Assembly Reference In MonoDevelop 2.4.1

查看:24
本文介绍了无法在 MonoDevelop 2.4.1 中添加 .NET 4.0 程序集参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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).

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

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

比 MD 显示一个错误,即我尝试添加的程序集不是 .NET 程序集.我在各处都将配置文件设置为 .NET 4.0.

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 可以很好地拆卸我的组件,所以没关系.我的操作系统是 Windows 7怎么了?

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

统一更新:向 Novell 发布了一个错误.这里是 https://bugzilla.novell.com/show_bug.cgi?id=659894

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

推荐答案

当我做 "C:Program FilesMono-2.8.1inmono.exe" "C:Program FilesMonoDevelopinMonoDevelop.exe" 问题消失.

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

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.

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

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));
        }
    }
}

AssemblyName.GetAssemblyName(Path.GetFullPath(str)); 行是万恶之源.我将向 Novell 发布错误报告.还是不是bug?

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?

这篇关于无法在 MonoDevelop 2.4.1 中添加 .NET 4.0 程序集参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆