Hi Stephen, The ObsoleteAttribute is a signal of intent. It basically tells developers "this will stop working in a future version so stop using it".
The way it has been used in your case (from your description) it is also a declaration of intent. It's saying "this is in use by me but you shouldn't use it". I'd argue that the constructor is not obsolete (and probably never will be). This intent could be made clearer by changing the visibility on those constructors to internal (if possible). I'd remove those attributes and get back to a clean (0 warning) build. They're just noise. Regards, Mike Michael M. Minutillo Indiscriminate Information Sponge http://codermike.com On Wed, Mar 6, 2013 at 12:59 PM, Stephen Price <[email protected]>wrote: > Hey all, > > The project i'm working on at the moment has some generated code from a > tool called MyGeneration TOOL. It has marked the default constructors of > the Data classes with: > > [Obsolete("For serialization only", false)] > > It would seem that they have ignored this and are using the default > constructors and then populating the properties, rather than calling the > overloads with parameters. In some cases it seems quite valid to just call > the default constructor (ie a new data object yet to be populated for > example). > > I've done some searching and can't find any justification for marking the > default constructors Obsolete. Given that the code is generated and then > manually pasted into the classes I'm tempted to just remove the Obsolete > attributes. It would clean up the Warnings generated drastically. Just want > to figure out if it might bite me for some reason down the track. > > flames, opinions, ideas, suggestions and feedback welcome :) > cheers, > Stephen >
