title: F# Namespaces/Modules and Interop with C#
body: <p>I've been experimenting with F# and would like to try using it in a C# project for certain pieces of code that would benefit from the language.</p>
  
  <p>I've been trying to figure out how Modules and Namespaces work when used within a C# project. For example, the following code:</p>
  
  <pre><code>namespace File1
  #light
  
  type File1(path : string) =
      static member Trim(p : string) = p.Trim()
      member self.Path = path
  </code></pre>
  
  <p>Then I try to use this in C# by saying:</p>
  
  <pre><code>using File1;
  
  class Program
  {
      static void Main(string[] args)
      {
          // Doesn't work
          Console.WriteLine(File1.Trim(" hello "));
          // Does work
          Console.WriteLine(File1.File1.Trim(" hello "));
      }
  }
  </code></pre>
  
  <p>I understand why the second one works, but why doesn't the first one work? I've pulled in the namespace with the using declaration and File1 should be a class. Trim is a static member of that class. </p>