Mono compilation error - Failed to load type 'System.Runtime.CompilerServices.ReferenceAssemblyAttribute' from assembly 'System'

I'm having trouble compiling my CSharp Mono application.

My mono version 2.10.2

This is the error I get

The .ctor method is missing in the assembly /home/tmc/AcctTerm/System.dll, type System.Runtime.CompilerServices.ReferenceAssemblyAttribute Could not find the custom constructor image attr: /home/tmc/AcctTerm/System.dll mtoken: 0x0a000054

Unhandled exception: System.TypeLoadException: Failed to load type 'System.Runtime.CompilerServices.ReferenceAssemblyAttribute' from assembly 'System'. at conAccountTerminator.cjcAccountTerminator..ctor () [0x00000] at: 0 at conAccountTerminator.MainClass.Main (System.String [] args) [0x00000] at: 0

Any ideas?

edit: Adding code;

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; } } } } 
+6
source share
1 answer

ReferenceAssemblyAttribute is a recent attribute first seen in FX 4.0.

Please make sure you use the Mono 'dmcs (or mcs with -sdk=4 ) to make sure that you are communicating with the version of mscorlib.dll (4.0) with the attribute.

+4
source

Source: https://habr.com/ru/post/906048/


All Articles