Note that there are some explanatory texts on larger screens.

plurals
  1. POF# Option goes bonkers when copying the solution to a different location
    text
    copied!<p>This is extremely strange, and I'm hoping someone will have some insights to make sense of this.</p> <p>I have an F# 2.0 (Visual Studio 2010, targeting .Net 4.0) solution which works fine in the location where I originally created it, but if I try and copy it to a new folder (because I want to check it in to source control), I get some very odd errors when building. They tend to be along the lines of:</p> <pre><code>error FS0803: Invalid use of a type name and/or object constructor. If necessary use 'new' and apply the constructor to its arguments, e.g. 'new Type(args)'. Overloads are: None() : unit. </code></pre> <p>or</p> <pre><code>error FS0001: This expression was expected to have type obj option but here has type Some&lt;'a&gt; </code></pre> <p>These errors are <em>only</em> occurring for uses of the option type, a simple example of one such usage being:</p> <pre><code>let asOption e = match e with | null -&gt; None | _ -&gt; Some(e) </code></pre> <p>Now, remember, this is a solution that compiles just fine in its original location. I've tried the obvious like Clean/Rebuild, deleting the obj and bin directories, restarting Visual Studion, and still, the same. </p> <p>The reference DLLs are all the same in both cases, GAC'd DLLs are being referenced from the GAC, non-GAC'd dlls are copied and being referenced from the same relative path. Just for fun, I've even compared the output window text of the calls to Fsc.exe used to compile each solution to ensure the compiler is being called with the same arguments in both cases, and, naturally, it is.</p> <p>Anyone have any idea of what may be causing this? Am I getting some strange limbo version of FSharp.Core.dll out of the GAC somehow? Am I just the most unlucky of the unlucky stiffs?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload