Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am having a problem in CodeMemberMethod.Attribute when I selected public as an attribute a "virtual" attribute is automatically added even if I dont initialize it. How am I able to eliminate the virtual attribute?

Is
C#
public virtual int Update() {
        }

different from
C#
public int Update() {
        }

[Edit]Code block added[/Edit]
Posted
Updated 21-Dec-12 1:16am
v2

This puzzled me for a while too and I discovered that both Public and Final attributes were required. Once I knew that, the documentation for the MemberAttributes enum made sense!

e.g.
C#
method.Attributes = MemberAttributes.Public | MemberAttributes.Final;

Alan.
 
Share this answer
 
Thank you very much for the answer i really appreciate it! Now I understand that you have to finalize the declared attribute so that it will not cause other interpretation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900