Custom Attributes and Code Generation

  • Thread starter Thread starter S-t-a-r-C-i-t-e
  • Start date Start date
S

S-t-a-r-C-i-t-e

When you use the [WebMethod] attribute code is generated for you.

I need to do the same for our corporate framework.

Can someone point me to an article/discussion on how to do?

I've seen that XC# does it.


Thanks in advance
 
Actually, WebMethodAttribute doesn't generate code at all. It is simply
a "flag" for a Visual Studio wizard that generates WSDL.

If you really want to venture into uncharted waters, you can take a look
at the IContextProperty and IContributeServerContextSink interfaces. You
can use these (undocumented) interfaces to interject code into a method
with a particular attribute. I'm not sure this is what you have in mind,
but there's more info here:

http://msdn.microsoft.com/msdnmag/issues/03/03/ContextsinNET/default.aspx

Regards,
-Jeff
 
Back
Top