Microsoft KB Archive/314626

= How To Attach an Attribute to a Method in Visual J# .NET =

Article ID: 314626

Article Last Modified on 8/30/2004

-

APPLIES TO


 * Microsoft Visual J# .NET 2003 Standard Edition
 * Microsoft Visual J# .NET 2003 Standard Edition

-



This article was previously published under Q314626



SUMMARY
This article describes the syntax that you can use to attach a code attribute to a method in Visual J# .NET.



MORE INFORMATION
You can attach code attributes to classes, fields, methods or method parameters by using the following syntax:

/** @attribute type */

The type name that follows @attribute must resolve to an attribute type in the current context. You can either give a fully qualified class name or a simple class name. If you give a simple class name, the import information is used to resolve the type.

For example, to set the Web method attribute in a Web service method, use the following: /** @attribute System.Web.Services.WebMethodAttribute */ Or, in the System.Web.Services context, you can use the following: /** @attribute WebMethodAttribute */

