Where does obselete attribute output?

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

I'm using the following code above a method signature::
[Obsolete("Will be removed in near future.")]

I don't see where this outputs anything for the builds. I have looked at
the Task List window and selected to see "All" but the above comments do not
show. Nothing about it in the output window either.

Any suggestions?

Thanks,
Brett
 
Brett,

Are you calling those obsolete methods? If you are not, then I don't
see why you would get a warning.

Also, these come up as warnings. You should go to the project
properties and set the option to treat warnings as errors, and you should
see them.

Hope this helps.
 
That's what it is - they aren't being called. I remember seeing the warning
before but wasn't sure why it went away.

Also, if I have a region defined with three methods and know this entire
region is obselete, can I obselete the region or must I obselete each method
within the region?

Thanks,
Brett

Nicholas Paldino said:
Brett,

Are you calling those obsolete methods? If you are not, then I don't
see why you would get a warning.

Also, these come up as warnings. You should go to the project
properties and set the option to treat warnings as errors, and you should
see them.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brett said:
I'm using the following code above a method signature::
[Obsolete("Will be removed in near future.")]

I don't see where this outputs anything for the builds. I have looked at
the Task List window and selected to see "All" but the above comments do
not show. Nothing about it in the output window either.

Any suggestions?

Thanks,
Brett
 
Brett,

Obsolete is an attribute, so you can't apply it to regions. You have to
apply it to anything in a class (including a class), but not to a region of
code.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brett said:
That's what it is - they aren't being called. I remember seeing the
warning before but wasn't sure why it went away.

Also, if I have a region defined with three methods and know this entire
region is obselete, can I obselete the region or must I obselete each
method within the region?

Thanks,
Brett

Nicholas Paldino said:
Brett,

Are you calling those obsolete methods? If you are not, then I don't
see why you would get a warning.

Also, these come up as warnings. You should go to the project
properties and set the option to treat warnings as errors, and you should
see them.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brett said:
I'm using the following code above a method signature::
[Obsolete("Will be removed in near future.")]

I don't see where this outputs anything for the builds. I have looked
at the Task List window and selected to see "All" but the above comments
do not show. Nothing about it in the output window either.

Any suggestions?

Thanks,
Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top