RSS registrovat login
Navigace: předchozí stranaúvodní strana
CS0128: An attribute argument must be a constant expression...

I have seen the following error on the build server: CSC error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type . On my machine everything worked fine. After some time, I found out that problem is that .Net FW 4.0 compiler does not support attibutes with optional arguments in constructor, e.g.

public class Attr : Attribute {

  public Attr(string param1, string param2 = null, string param3 = null) { }

}

It worked in .Net FW 4.5 compiler. To solve the issue, I removed optional parameters and rewritten it to several constructors with different number of parameters.

Informace ke stavu builder.cz zde


vytvořil Mi.Chal. 27.6. 2013 22:13, naposledy změněnil Mi.Chal. 27.6. 2013 22:23
přečteno: 3276x

Komentáře:
Žádné komentáře dosud nebyly vloženy.

Přidat komentář:
Jméno
E-mail
Web
Titulek
Obsah
thomas sabo rea mbt outlet thomas sabo charms sale louis vuitton taschen kaufen thomas sabo boutique mbt kaufen