title: C# Value Cannot be null using Path.Combine
body: <p>I'm attempting to construct a database using the C# Console, but I'm getting an error thrown that I can't seem to find the problem with. The problem is in my Query function, when I attempt to define the path based off of user input. Essentially, it looks into a given folder in the user folder, and within it another subfolder containing the files wherein is the database information. Im using the Path.Combine function to dynamically define the path throughout my code, but I'm getting the following error;</p>
  
  <p>ArgumentNullException: Value cannot be null. (Parameter 'path3')</p>
  
  <p>Even though all strings are defined and not null. </p>
  
  <p>this is what the line of code looks like:</p>
  
  <pre><code>path = Path.Combine(Info.path, "infolder", classrooms.inventory, classrooms.geninv, userinput)
  </code></pre>
  
  <p>And here is all of the code that the strings in the path arguement are referencing:</p>
  
  <pre><code>class classrooms
  {
      public static string Teacher;
      public static string Roomnumber;
      public static string Changes;
      public static string inventory = "inventory";
      public static string geninv = "GenInv";
      public static string classinv = "ClassInv";
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Info
      {
          public static string path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
      }
  </code></pre>
  
  <p>if necessary I can attach my full code.</p>
  
  <p><a href="https://i.stack.imgur.com/3ot36.png" rel="nofollow noreferrer">Screenshot of Error</a></p>