obsolete

What are the C functions from the standard library that must / should be avoided ?

I've read on stackoverflow that some C functions are 'obsolete' or should be 'avoided'. Can you please give me some examples of this kind of functions + the reason why. What alternatives of those function exists ? Can we use them safely - any good practices ? Later edit: From the answers: gets : can cause buffer overflows. scanf : f...

What does <project> is obsolete mean?

My batch build has a project, lets call it 'My.Project'. That project got up-reved to .NET 3.5 (from .NET 1.1) in its own standalone project (meaning its not part of this batch build). Most of it is the same, there are calls that were upgraded, features added/removed. I go to start replacing all calls that all the other projects use t...

AOP and .NET: Is Contexts an obsolete concept?

Recently I've started learning about Contexts in .NET (context-bound, context-agile, message sinks, etc.). Several alarm bells started ringing: All context-bound classes are derived from ContextBoundObject, which in turn is derieved from MarshalByRefObject. MarshalByRefObject is a part of the .NET Remoting architecture. The .NET Remot...

Ambiguous class name

Hello If have a new project (ProjNew ) where I want to put several classes that are on other project (ProjOld). The problem is I want to maintain the old classes marked with Obsolete to avoid running all my projects and check if they using it. But in that way this may throw a ambiguous class name error because I didn't explicitly cal...

Obsolete attribute doesn't cause any compiler warning in VS2010

Hi, I'm using Visual Studio 2010. But find that the Obsolete attribute doesn't cause any compiler warning (I want it to cause a compiler warning). The warning level is 4. Thanks. ...

Is Obsolete attribute only checked at Compile time?

Hi, I wonder that the obsolete attribute is checked at only runtime? Think that you have two assemblies. Assembly A uses a method from Assembly B. After that we mark the method in Assembly B as obsolete which causes a compile time error when compiling assembly A. No problem so far but the question is whether the older assembly A cont...

.NET Framework deprecated interfaces and attributes. What was your biggest refactoring due to lack of support?

Some .net-framework interfaces and attributes become obsolete and deprecated since new framework version appears. I am warned that such code may be removed or become unpredictable in next versions but have you ever faced the situation when you were forced to refactor code because code came uncompilable or start to behave weird? What was ...

Properly obsoleting old members in an XML Serializable class in C# VB .NET

Hi! Sometime ago I defined a class that was serialized using XML. That class contained a serializable property Alignment of integer type. Now I have extended and updated this class, whereby a new property Position was added, whose type is another class that also has several serializable properties. The new property Position is now suppos...

Mark as Obsolete

Hi, I am trying to find all the unused methods of my project. I have search ways of doing this, but the most convincing answer I found was to declare all my functions as obsolete, and remove this attribute until I got no warnings. The problem is that I don't know how to declare a function as obsolete. When I write: [Obsolete] cl...

Usage of the Obsolete attribute

I was recently told it was bad practice to haved marked a number of methods in our code with the [Obsolete] attribute. These methods were internal to our codebase, rather than being on an API. The methods handled an older encryption function. I felt it was a quick and safe way to denote to the rest of the team that these methods should ...

How can I mark a specific parameter as obsolete/deprecated in C#?

I would like to be able to keep a C# API the same as it is now, but simply deprecate one of the parameters in a method call. Is it possible to do so, or do I need to create a new method without the parameter and mark the original one as Obsolete? ...