无法添加.NET 4.0大会在参考MonoDevelop的2.4.1 [英] Can't add .NET 4.0 Assembly Reference In MonoDevelop 2.4.1

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

问题描述

我已经安装的MonoDevelop 2.4.1单声道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.

反射器拆卸我组装精细所以没关系。 我的操作系统是Windows 7 怎么了?

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

UPD: 发布到Novell的错误。这是<一个href="https://bugzilla.novell.com/show_bug.cgi?id=659894">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 Files文件\单-2.8.1 \ BIN \ mono.exeC:\ PROGRAM文件\ MonoDevelop的\ BIN \ MonoDevelop.exe问题在前看不见。

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

它的了解,通过运行MonoDevelop.exe它运行在微软.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.

让我们看看code(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?

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

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