简体   繁体   中英

Compiling an F# 2.0 project in VS2012

I have a solution for VS2010 that includes some F# projects that work against the F# 2.0 compiler/SDK, leveraging fparsec and fsharp powerpack.

I then upgraded my main development machine to VS2012, loaded the solution and was able to compile just fine.

However I just repaved a seperate machine with windows 8 and VS2012, and loading the solution on that machine causes compilation failure, as the project is targeting F# 3.0, and fparsec/fsharp powerpack don't appear to compile any more.

Is it possible to install the FSharp 2.0 SDK (and if so, where do I get it from?) on this new windows 8 machine and get the solution to compile again, or would I need to do something else to get this working on both the old and new machine?

Updated 2012-10-25

Compilation is now working after restarting VS2012, but when executing code I'm getting an unexpected error related to my F# code:

Method not found: 'ParserResult`2<!!0,Microsoft.FSharp.Core.Unit> FParsec.CharParsers.run(
Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<Microsoft.FSharp.Core.Unit>,
FParsec.Reply`1<!!0>>, System.String)'.

This does not happen when compiling/executing the same code on a machine that had first VS2010 installed with F# and then was upgraded to vs2012 - only happening on the machine which has just vs2012 installed.

Any ideas?

If you set the target framework to "4.0" (or lesser), it should compile the same as F# 2.0 (with a few new nice features, such as auto properties). I see no reason to insist on leaving out the new features, and definitely no reason to leave out all the bug fixes that came with F# 3.0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM