Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8016577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:34:34+00:00 2026-06-04T20:34:34+00:00

Note: I already checked msdn, it doesn’t address my actual question, see below. I’m

  • 0

Note: I already checked msdn, it doesn’t address my actual question, see below.

I’m trying to use the obsolete attribute on a (obviously obsolete) constructor in one of my classes. Here’s the scenario:

I want to be able to force the developer to update to the new constructor without affecting already existing and deployed code. This way I can deploy my code to production just fine, but from a developers perspective, whenever they go into their code, instead of just getting a “warning” which I’m sure they’ll just ignore, I want them to get a compile error because the status quo is no longer ok.

So my question is, will this affect only developers, or all calling apps, or do I have the whole thing wrong?

sample code:

public class MyClass
{
   private string _userID; //new code

   [Obsolete("This constructor is obsolete, please use other constructor.", true)]
   public MyClass()
   {
      _userID = ""; //defaulting to empty string for all those using this constructor
   }

   public MyClass(string userID)
   {
      _userID = userID; //this is why they need to use this constructor
   }
}

Any and all help will be appreciated, thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:34:35+00:00Added an answer on June 4, 2026 at 8:34 pm

    Yes, this primarily affects the compiler – any pre-built code won’t be affected… unless that code explicitly checks for this attribute. For example, some serialization code (XmlSerializer, IIRC) checks for this – so it might not be entirely side-effect free… but in principal existing code won’t usually be affected until they try to compile next.

    Of course, if you are using this code from something that uses dynamic compilation (for example ASP.NET without pre-compile) then all bets are off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a GWT Date Time Component? Note: I am already making use of
[Please note that this is a different question from the already answered How to
A foreword note that this is for an assignment. A question has already been
Note: Already asked in this post (asked on StackOverflow) . However, the problem is
NOTE: Please, don't code it for me. I already have a home-rolled function to
Note: I have very little python and PyQt experience... Given a context menu already
NOTE: This is an entire rewrite of the previous question. I have a model.
I already double checked my URL, and the name of the files, but I
Is there any other use of the question mark ? in PHP other than
I'm trying to use the persistence specification testing built into FNH. The CheckList method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.