title: Error creating instance of C# class in F# script file
body: <p>I have the following C# class that I would like to make use of in F#</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace DataWrangler.Structures
  {
      public enum Type { Trade = 0, Ask = 1, Bid = 2 }
  
      public class TickData
      {
          public string Security = String.Empty;
          public uint SecurityID = 0;
          public object SecurityObj = null;
          public DateTime TimeStamp = DateTime.MinValue;
          public Type Type;
          public double Price = 0;
          public uint Size = 0;
          public Dictionary&lt;string, string&gt; Codes;
      }
  }
  </code></pre>
  
  <p>I would like to create an instance of it in F#. The code I am using to do this is in an f# script file</p>
  
  <pre><code>#r @"C:\Users\Chris\Documents\Visual Studio 2012\Projects\WranglerDataStructures\bin\Debug\WranglerDataStructures.dll"
  
  open System
  open System.Collections.Generic;
  open System.Text;
  open DataWrangler.Structures
  
  type tick = TickData // &lt;- mouse over the "tick" gives me a tooltip with the class structure
  
  // it bombs out on this line 
  let tickDataTest = tick(Security = "test", TimeStamp = DateTime(2013,7,1,0,0,0), Type = Type.Trade, Price = float 123, Size = uint32 10 )
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>error FS0193: internal error: Could not load file or assembly 'file:///C:\Users\Chris\Documents\Visual Studio 2012\Projects\WranglerDataStructures\bin\Debug\WranglerDataStructures.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  </code></pre>
  
  <p>I have checked the file paths and they seem to be correct. I can mouse over the 'type tick' and it gives me the structure of the C# object. So It seems to be finding the C# code. Can anyone tell me what I am doing wrong here? Syntax? Still very new to C# -> F# introp </p>