haggag87
haggag87

Reputation: 31

System.Configuration.DefaultSettingValueAttribute

[global::System.Configuration.DefaultSettingValueAttribute("s")]

The string "s" must be constant. How can I pass a variable string?

I mean I want it like this:

[global::System.Configuration.DefaultSettingValueAttribute(s1+"s")]

and s1 is a string.

Upvotes: 1

Views: 2152

Answers (1)

Andrew Kennan
Andrew Kennan

Reputation: 14157

You cannot. Like the error message says, a parameter to an attribute must be a constant value, known at compile time.

Upvotes: 2

Related Questions