Mono编译错误-无法从程序集“系统"中加载类型"System.Runtime.CompilerServices.ReferenceAssemblyAttribute" [英] Mono Compiling Error - Could not load type 'System.Runtime.CompilerServices.ReferenceAssemblyAttribute' from assembly 'System'

查看:364
本文介绍了Mono编译错误-无法从程序集“系统"中加载类型"System.Runtime.CompilerServices.ReferenceAssemblyAttribute"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am having trouble compiling my CSharp Mono application.

我的单声道版本为2.10.2

My Mono Version is 2.10.2

这是我收到的错误

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

Missing method .ctor in assembly /home/tmc/AcctTerm/System.dll, type System.Runtime.CompilerServices.ReferenceAssemblyAttribute Can't find custom attr constructor image: /home/tmc/AcctTerm/System.dll mtoken: 0x0a000054

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

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ReferenceAssemblyAttribute' from assembly 'System'. 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;
            }
        }        
    }
}

推荐答案

ReferenceAssemblyAttribute is a recent attribute, first seen in FX 4.0.

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

Please ensure you're using Mono 'dmcs compiler (or mcs with -sdk=4) to ensure you're linking with a version of mscorlib.dll (4.0) that has the attribute present.

这篇关于Mono编译错误-无法从程序集“系统"中加载类型"System.Runtime.CompilerServices.ReferenceAssemblyAttribute"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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