title: Why am I having an issue with making a nullable integer a property?
body: <p>I made a modification to an existing piece of .NET 4 code to make a new property which consisted of a nullable integer. It runs in a Windows Service.</p>
  
  <pre><code>    public static int? Port
      {
          get;
          set;
      }
  </code></pre>
  
  <p>The concept was that if the value was null it was ignored but if it wasn't then it was used (a non-default scenario)</p>
  
  <pre><code>    if (Port != null)
      {
          client = new Client( Server, Port.Value );
      }
      else
      {
          client = new Client( Server );
      }
  </code></pre>
  
  <p>On my machine, it works as expected. </p>
  
  <p>However, when deployed to our testing servers I'm getting exceptions when it's called from an ASP.NET site. Here's the formatted exception output:</p>
  
  <pre><code>Exception: System.MissingMethodException
  Exception Message: Method not found: 'Void NameOfAssembly.set_Port(System.Nullable`1&lt;Int32&gt;)'.
  Exception Data: System.Collections.ListDictionaryInternal
  Exception TargetSite: ** Unable to GetValue **
  Exception HelpLink: NULL
  </code></pre>
  
  <p>It's as if either the code wasn't deployed correctly, or it just can't find the automatic get/set methods. A coworker has made a subsequent change that does work in our testing environment so I don't think it's a deployment issue. </p>
  
  <p>I can't think of any reason this would happen, other than possibly Windows Server (2008 R2) operating differently than Windows 7 where I developed it, but that's a stretch.</p>
  
  <p>Has anyone ever seen this before?</p>