We want to set a attribute value from app.config and using following code, it gives error
"An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type"
- public class A
- {
- [JsonProperty(ConfigurationManager.AppSettings["Application:ExplicitUserTypeAttribute"]]
- public string ExplicitUserTypeAttribute { get; set; }
- }
I understand this has to be a constant that can be computed at compile time but this is our requirement and I'm wondering if there is any work around to get it working.
Thanks!
Sanwar RanwaPosted Dec 21, 2018, 10:17 PM
Jignesh KumarPosted Dec 21, 2018, 10:04 AM