单声道编译错误 - 无法从程序集"系统"加载类型"System.Runtime.CompilerServices.ReferenceAssemblyAttribute"

Jef*_*rts 6 c# mono

我在编译CSharp Mono应用程序时遇到问题.

我的单声道版本是2.10.2

这是我收到的错误

程序集中缺少方法.ctor /home/tmc/AcctTerm/System.dll,类型为System.Runtime.CompilerServices.ReferenceAssemblyAttribute找不到自定义attr构造函数图像:/home/tmc/AcctTerm/System.dll mtoken:0x0a000054

未处理的异常:System.TypeLoadException:无法从程序集"System"加载类型"System.Runtime.CompilerServices.ReferenceAssemblyAttribute".at conAccountTerminator.cjcAccountTerminator..ctor()[0x00000] in:0 at conAccountTerminator.MainClass.Main(System.String [] args)[0x00000] in:0

有任何想法吗?

编辑:添加代码;

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;
            }
        }        
    }
}
Run Code Online (Sandbox Code Playgroud)

pou*_*pou 4

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

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