Tuesday, July 13, 2010

An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type




I got this error when trying to dynamically set the WebServiceNamespace attribute, from a value from the web.config. If you're trying to do this, don't do it. See this thread for reasons why not to: http://forums.asp.net/p/1171781/1963223.aspx

If you actually need to dynamically update an attribute then follow this article: http://geekswithblogs.net/abhijeetp/archive/2009/01/10/dynamic-attributes-in-c.aspx


No comments:

Post a Comment

There was an error in this gadget