You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding type Stocks = CsvProvider<"./data/MSFT.csv"> to https://github.com/fsprojects/ProjectScaffold/blob/master/src/FSharp.ProjectTemplate/Library.fs causes a FSharp.Formatting Error
Repro steps
Please provide the steps required to reproduce the problem
1.a Use forge new scaffold to create a new Scaffold.
1.b Add nuget FSharp.Data to group Build in paket.dependencies: https://github.com/fsprojects/ProjectScaffold/blob/master/paket.dependencies#L18
1.c Modify https://github.com/fsprojects/ProjectScaffold/blob/master/src/FSharp.ProjectTemplate/Library.fs and call CsvProvider (something like this):
namespaceProcessingDataopenFSharp.Data/// Stock prices exampletypeStocks= CsvProvider<"./data/MSFT.csv">/// Documentation for my library////// ## Example////// let h = Library.hello 1/// printfn "%d" h///moduleLibrary =/// Returns 42////// ## Parameters/// - `num` - whateverlethello num =42
I am getting the following error for GenerateReferenceDocs target:
Starting Target: GenerateReferenceDocs (==> RunTests, GenerateHelp)
Building documentation (Default), this could take some time, please wait...
C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\packages\build\FAKE\tools\FAKE.exe --fsiargs -d:FAKE -d:RELEASE -d:REFERENCE "generate.fsx"
FSharp.Formatting Information: 0 : FSharp.Formatting Logging setup!
Yaaf.FSharp.Scripting Information: 0 : Yaaf.FSharp.Scripting Logging setup!
Copying file: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\img\logo-template.pdn
Copying file: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\img\logo.png
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\style.css
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\style.css.bak
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\style_light.css
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\tips.js
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\img\github-blue.png
Copying styles and scripts: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docs\content\img\github.png
Deleting contents of C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\docsrc\tools\../../docs\reference
FSharp.Formatting Error: 0 : Could not read comments from entity 'ProcessingData.Stocks': Microsoft.FSharp.Compiler.ErrorLogger+ReportedError: Exception of type 'Microso
ft.FSharp.Compiler.Tast+InternalUndefinedItemRef' was thrown.
at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Error[b](ErrorLogger x, Exception exn) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fs
harp\ErrorLogger.fs:line 313
at Microsoft.FSharp.Compiler.Tast.EntityRef.get_Deref() in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\tast.fs:line 2684
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsA(TcGlobals g, Boolean canShortcut, TType ty) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\TastOps.fs:line
627
at Microsoft.FSharp.Compiler.Tastops.extensionInfoOfTy(TcGlobals g, TType ty) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\TastOps.fs:line 1464
at Microsoft.FSharp.Compiler.Tastops.metadataOfTy(TcGlobals g, TType ty) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\TastOps.fs:line 1489
at Microsoft.FSharp.Compiler.Infos.GetImmediateIntrinsicPropInfosOfType(FSharpOption`1 optFilter, AccessorDomain ad, TcGlobals g, ImportMap amap, range m, TType typ)
in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\infos.fs:line 3293
at <StartupCode$FSharp-Compiler-Service>[email protected](IEnumerable`1& next) in C:\Users\robin\dev\FSharp.Compiler.Service\
src\fsharp\vs\Symbols.fs:line 426
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
at <StartupCode$FSharp-Compiler-Service>[email protected](Unit unitVar0) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\vs\
Symbols.fs:line 412
at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.protect[a](FSharpFunc`2 f) in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:line 27
at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpEntity.get_MembersFunctionsAndValues() in C:\Users\robin\dev\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:li
ne 411
at [email protected](IEnumerable`1& next) in c:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:l
ine 0
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
at [email protected](String cat, IDictionary`2 cmds, Comment comment) in c:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.Metada
taFormat\Main.fs:line 1070
at FSharp.MetadataFormat.Reader.readCommentsInto[a](FSharpSymbol sym, ReadingContext ctx, String xmlDoc, FSharpFunc`2 f) in c:\Tomas\Public\tpetricek\FSharp.Formattin
g\src\FSharp.MetadataFormat\Main.fs:line 944
FSharp.Formatting Information: 0 : Starting razor engine
FSharp.Formatting Information: 0 : Generating: index.html
FSharp.Formatting Information: 0 : Generating modules...
FSharp.Formatting Information: 0 : Generating module: processingdata-library
FSharp.Formatting Information: 0 : Finished module: processingdata-library
FSharp.Formatting Information: 0 : Generating types...
Finished Target: GenerateReferenceDocs
Known workarounds
None yet :(
Related information
Operating system
Windows 10 Pro 64 bits (running on top of Parallels 12 for Mac).
Branch
.NET Runtime, CoreCLR or Mono Version
** Verifying the fsc version:
fsc --help
Microsoft (R) F# Compiler version 14.0.23020.0
I think my installation is not respecting/using this variable, because at the top of the build, I get a message saying that version 15.3.409.57025 of MSBuild is being used:
Starting Target: Build (==> AssemblyInfo)
Building project: C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\ProcessingData.sln
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\ProcessingData.sln /t:Rebuild /m /nodeReuse:False /p:RestorePackages="False" /p:Configuration="Release" /p:Configuration="Release" /p:Platform="Any CPU" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\Users\oscarvarto\gitRepos\dotnetWork\ProcessingData\packages\build\FAKE\tools\FakeLib.dll"
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
FSHARPINSTALLDIR pointing to C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\ (I guess VS 2017 installation added that).
Maybe this variable is messing with my build, because I am also getting a message about F# 4.1 being used:
This is almost certainly not an issue with ProjectScaffold (that having been said...)
Have you tried deleting the FAKE cache (it's the .fake folder at the root of your local repository)?
Have you tried pinning (in Paket) the versions of FSharp.Compiler.Service and/or FSharp.Formatting (note: you may have to play around with going up or down a version or two in each project)?
Also, I'm pretty sure you do want to be using F# 4.1. But I agree the MSBuild versions are... troubling.
Oh, also, what version of the runtime are you targeting (e.g. .NET Framework 4.6.1, .NET Stanard 2.0, et cetera)?
Description
Adding
type Stocks = CsvProvider<"./data/MSFT.csv">
tohttps://github.com/fsprojects/ProjectScaffold/blob/master/src/FSharp.ProjectTemplate/Library.fs
causes a FSharp.Formatting ErrorRepro steps
Please provide the steps required to reproduce the problem
1.a Use
forge new scaffold
to create a new Scaffold.1.b Add
nuget FSharp.Data
togroup Build
inpaket.dependencies
: https://github.com/fsprojects/ProjectScaffold/blob/master/paket.dependencies#L181.c Modify
https://github.com/fsprojects/ProjectScaffold/blob/master/src/FSharp.ProjectTemplate/Library.fs
and call CsvProvider (something like this):1.d Add a
data
folder inside project folder (in my case [root project folder]/src/ProcessingData) and put http://fsharp.github.io/FSharp.Data/data/MSFT.csv inside it..\build.cmd
to run all the targets.Expected behavior
Build correctly.
Actual behavior
I am getting the following error for
GenerateReferenceDocs
target:Known workarounds
None yet :(
Related information
Operating system
Windows 10 Pro 64 bits (running on top of Parallels 12 for Mac).
Branch
.NET Runtime, CoreCLR or Mono Version
** Verifying the fsc version:
I have already installed VS 2017 15.3.2
PATH
Environment variables:MSBUILD_PATH
environment variable following instructions from https://github.com/ionide/ionide-vscode-fsharp/ pointing toC:\Program Files (x86)\MSBuild\14.0\Bin
I think my installation is not respecting/using this variable, because at the top of the build, I get a message saying that version 15.3.409.57025 of MSBuild is being used:
FSHARPINSTALLDIR
pointing toC:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\
(I guess VS 2017 installation added that).Maybe this variable is messing with my build, because I am also getting a message about F# 4.1 being used:
fsprojects/FSharp.Formatting#423
fsprojects/FSharp.Formatting#325
The text was updated successfully, but these errors were encountered: