Error: Attribute constructor has an invalid parameter type

Problem When you try to pass in an attribute constructor parameter to a custom attribute, you get one of the following compiler errors: Error CS0181 Attribute constructor parameter has type ‘Color’ which is not a valid attribute parameter type Error CS0655 ‘Color’ is not a valid named attribute argument because it is not a valid … Read more

C# – Parse a comma-separated string from app.config

I’ll show how to parse comma-separated integer values from app.config and load them into a HashSet for efficient lookups. First, take a look at the setting (retryStatusCodes) in app.config: To load and parse this setting from app.config, do the following: The following code shows how to do this: Note: You have to add a reference … Read more