我在编译 CSharp Mono 应用程序时遇到问题。
我的Mono版本是2.10.2
这是我收到的错误
程序集 /home/tmc/AcctTerm/System.dll 中缺少方法 .ctor,类型为 System.Runtime.CompilerServices.ReferenceAssemblyAttribute
找不到自定义 attr 构造函数图像:/home/tmc/AcctTerm/System.dll mtoken:0x0a000054
未处理的异常:System.TypeLoadException:无法从程序集“System”加载类型“System.Runtime.CompilerServices.ReferenceAssemblyAttribute”。
在 conAccountTerminator.cjcAccountTerminator..ctor () [0x00000] 中:0
在 conAccountTerminator.MainClass.Main (System.String[] args) [0x00000] 中: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 http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.referenceassemblyattribute.aspx是最近出现的属性,首次出现在 FX 4.0 中。
请确保您使用的是 Mono'dmcs
编译器(或mcs
with -sdk=4
)以确保您链接的版本mscorlib.dll
(4.0) 具有该属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)