title: Design without default constructor
body: <p>I want to restrict creating object using default constructor. Because I have a desing like below:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          BaseClass bc = new BaseClass("","");
          XmlSerializer xml = new XmlSerializer(typeof(BaseClass));
          StreamWriter sw = new StreamWriter(File.Create("c:\\test.txt"));
          xml.Serialize(sw,bc);
          sw.Flush();
          sw.Close();
      }
  }
  [Serializable]
  public class BaseClass
  {
      public string UserName, Password;
      // I don't want to create default constructor because of Authentication
      public BaseClass(string _UserName, string _Password)
      {
          UserName = _UserName;
          Password = _Password;
          f_Authenticate();
      }
      private void f_Authenticate() { }
  }
  
  public class DerivedClass:BaseClass
  {
      public DerivedClass(string _UserName, string _Password) : base(_UserName, _Password)
      {
      }
  }
  </code></pre>
  
  <p>This is ok. But when I make BaseClass to Serializable it'll generate this error:
  <code>Unhandled Exception: System.InvalidOperationException: ConsoleApplication1.BaseC
  lass cannot be serialized because it does not have a parameterless constructor.</code></p>
  
  <p>Now my design is collapsing because I need to have <code>Username</code>, <code>Password</code> parameters but default constructor is ruining my design....</p>
  
  <p>What should I do?</p>