Mono编译错误 - 无法从程序集'System'中加载类型'System.Runtime.CompilerServices.ReferenceAssemblyAttribute'

6
我无法编译我的C# Mono应用程序。
我的Mono版本是2.10.2
这是我收到的错误信息:
缺少方法。在程序集/home/tmc/AcctTerm/System.dll中,类型System.Runtime.CompilerServices.ReferenceAssemblyAttribute无法找到自定义attr构造函数映像:/home/tmc/AcctTerm/System.dll mtoken:0x0a000054
未处理的异常:System.TypeLoadException:无法从程序集“System”加载类型“System.Runtime.CompilerServices.ReferenceAssemblyAttribute”。
在conAccountTerminator.cjcAccountTerminator..ctor() [0x00000]处 在conAccountTerminator.MainClass.Main(System.String[] args) [0x00000]处
有什么建议吗?
编辑:添加代码;
using System;
using System.Net;
using System.Collections;
using System.Web;
using System.Text;
using System.IO;
using MySql;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Security;
using System.Security.Authentication;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Data;
using System.Xml;

namespace conAccountTerminator
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            cjcAccountTerminator cjcAccountTerm = new cjcAccountTerminator();

            switch (args[0])
            {
                case "update":
                    cjcAccountTerm.LoginToMyBilling();
                    break;
                case "notepad":
                    cjcAccountTerm.UpdateCustomerData(args[1], args[2]);
                    break;
                case "terminate":
                    cjcAccountTerm.TerminateAccount(args[1]);
                    break;
            }
        }        
    }
}

你有任何代码可以分享吗?看起来像是一个没有构造函数的自定义属性。 - Coder2000
有些有趣的路径,你在/home/tmc/AccTerm中安装了Mono吗?看起来System.dll的位置很奇怪。 - IanNorton
1个回答

4

ReferenceAssemblyAttribute是最近出现的属性,在FX 4.0中首次出现。

请确保您使用Mono'dmcs编译器(或带有-sdk=4mcs)以确保您链接到具有该属性的mscorlib.dll(4.0)版本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接