我在编译 CSharp Mono 应用程序时遇到问题。
我的单声道版本是 2.10.2
这是我收到的错误
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
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
是最近出现的属性,首次出现在 FX 4.0 中。
请确保您使用的是 Mono 'dmcs
编译器(或 mcs
with -sdk=4
)以确保您正在链接具有当前属性的 mscorlib.dll
(4.0) 版本。
关于c# - Mono 编译错误 - 无法从程序集 'System.Runtime.CompilerServices.ReferenceAssemblyAttribute' 加载类型 'System',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8873091/