I have upgraded F# PowerPack today from 1.9.9.9 to the latest 2.0.0.0 and tried to rebuild the MiniCalc sample from here: http://achrissmith.blogspot.com/2010/04/fslex-and-fsyacc-examples-updated.html
If I build it in VS 2010 it fails with the message:
C:\Program Files\MSBuild\FSharp\1.0\FSharp.PowerPack.targets(32,3): error MSB6004: The specified task executable location "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\fslex.exe" is inv开发者_如何学Pythonalid.
If I build it from the command line by MSBuild it complains about missing
C:\Windows\Microsoft.NET\Framework\v4.0.30319\fslex.exe
The problem is kind of “fixed” if I copy fslex
and fsyacc
to that both directories, so after that I can build from the command line and from VS 2010. But it does not look like a right way to solve the problem. What is the right way?
EDIT: The same issue is true for the PowerPack sample from sources: May2010\workyard\tests\LexAndYaccMiniProject
. Now (after the trick I have done) it is built fine, too.
It turns out to be a bug. See: http://fsharppowerpack.codeplex.com/WorkItem/View.aspx?WorkItemId=4548 The workaround is explained there. I have written a PowerShell script that does the patch:
# Run this after installation of F# PowerPack 2.0.0.0
$path = 'HKLM:\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\FSharp.PowerPack-1.9.9.9'
$null = New-Item $path -Force
$bin = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\FSharp.PowerPack-2.0.0.0').'(default)'
Set-ItemProperty $path '(default)' $bin
Roman is right; the PowerPack May2010 release has since been updated to fix this.
精彩评论