Linux 生成文档时出现 ProjectScaffold 错误
ProjectScaffold Error on Linux Generating Documentation
我在 ProjectScaffold 上有一个 project based 并且正在尝试获得一个好的构建。除了我在尝试生成文档时不断收到此错误。
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0034230
AssemblyInfo 00:00:00.0089835
Build 00:00:04.1197276
CopyBinaries 00:00:00.0032325
RunTests 00:00:00.4153411
CleanDocs 00:00:00.0002847
Total: 00:00:12.2516707
Status: Failure
---------------------------------------------------------------------
1) System.Exception: generating help documentation failed
at FSI_0001.Build.generateHelp' (Boolean fail, Boolean debug) [0x00000] in <filename unknown>:0
at FSI_0001.Build+clo@218-18.Invoke (Microsoft.FSharp.Core.Unit _arg1) [0x00000] in <filename unknown>:0
at Fake.TargetHelper+targetFromTemplate@155[Microsoft.FSharp.Core.Unit].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <filename unknown>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) [0x00000] in <filename unknown>:0
到目前为止的疑难解答:
我专门针对该异常进行了搜索,得到了这个结果 - single google result. In that result that links here 似乎为某些依赖项添加了特定的版本挂钩,如下所示:
nuget FSharp.Formatting 2.8.0
nuget FSharpVSPowerTools.Core 1.7.0
它似乎对某些人有用,但对我不起作用。之后我仍然遇到同样的问题。也许我需要再次拉取依赖关系?我不确定。
我想做以下两种可能的事情之一:
- 解决问题。这当然是理想的。 :)
- 以某种方式删除 ProjectScaffold 的文档生成器。
执行 generate.fsx 文件我得到以下结果。
adron@ubuntu ~/C/sharpKataStringCalc> fsharpi docs/tools/generate.fsx
Copying file: /home/adron/Codez/sharpKataStringCalc/docs/output/img/logo-template.pdn
Copying file: /home/adron/Codez/sharpKataStringCalc/docs/output/img/logo.png
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/style.css
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/style_light.css
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/tips.js
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/img/github-blue.png
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/img/github.png
我能够 运行 使用此命令根据 Tomas 的建议构建文档:
fsharpi -d:HELP docs/tools/generate.fsx and fsharpi -d:REFERENCE docs/tools/generate.fsx
...并出现以下错误:
Processing the file 'docpage' failed
Source written to: '/tmp/tmp4a1e2cc4.tmp.cs'
Compilation errors:
- error: (0, 0) Assembly `FakeLib, Version=3.35.2.0, Culture=neutral, PublicKeyToken=null' references `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version number than imported assembly `FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
System.Exception: Generating HTML failed.
at FSharp.Literate.RazorRender.handleCompile[String] (System.String source, Microsoft.FSharp.Core.FSharpFunc`2 f) [0x00000] in <filename unknown>:0
at FSharp.Literate.RazorRender.ProcessFileModel[IDictionary`2] (System.Type modelType, System.Object model, Microsoft.FSharp.Core.FSharpOption`1 properties) [0x00000] in <filename unknown>:0
at FSharp.Literate.Templating.generateFile (Microsoft.FSharp.Core.FSharpOption`1 references, System.String contentTag, IEnumerable`1 parameters, Microsoft.FSharp.Core.FSharpOption`1 templateOpt, System.String output, IEnumerable`1 layoutRoots) [0x00000] in <filename unknown>:0
at FSharp.Literate.Templating.processFile (Microsoft.FSharp.Core.FSharpOption`1 references, FSharp.Literate.LiterateDocument doc, System.String output, FSharp.Literate.ProcessingContext ctx) [0x00000] in <filename unknown>:0
at FSharp.Literate.Literate.ProcessScriptFile (System.String input, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 output, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in <filename unknown>:0
at <StartupCode$FSharp-Literate>.$Main+processScriptFile@184.Invoke (System.String file, System.String output) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.String].InvokeFast[Unit] (Microsoft.FSharp.Core.FSharpFunc`2 func, System.String arg1, System.String arg2) [0x00000] in <filename unknown>:0
at <StartupCode$FSharp-Literate>.$Main.processDirectory@199 (Microsoft.FSharp.Core.FSharpOption`1 format, Boolean processRecursive, Microsoft.FSharp.Core.FSharpFunc`2 processScriptFile, Microsoft.FSharp.Core.FSharpFunc`2 processMarkdown, System.String indir, System.String outdir) [0x00000] in <filename unknown>:0
at FSharp.Literate.Literate.ProcessDirectory (System.String inputDirectory, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 outputDirectory, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 processRecursive, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in <filename unknown>:0
at FSI_0003.buildDocumentation () [0x00000] in <filename unknown>:0
at <StartupCode$FSI_0003>.$FSI_0003.main@ () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Stopped due to error
所以这里的事情变得有点有趣了。我将所有内容恢复到 generate.fsx 文件中的状态并进行了构建。它坏了,正如我怀疑上面的错误。然后,偶然我注意到我需要在 Ubuntu 14.04 本身上升级一些东西。所以我点击安装并开始下载大约 600+ MB 的补丁和更新。完成后,我不得不重新启动并且 fs 无法安装。所以我重新启动,进入安全模式,让 Ubuntu 运行 为操作系统上安装的所有内容重建一个包。完成后,我正常启动并启动 Visual Studio 代码和 bash 以重新开始解决此问题。
那是我进行构建并且一切都完美通过的时候。这个故事的寓意,似乎 Ubuntu 14.04 需要最新的补丁以及确保安装最新的单声道。似乎必须有一些单声道依赖,这是生成文档所必需的。
如果您想了解有关该问题的更多信息以及为解决该问题所做的工作,请在 Github 上查看此问题:https://github.com/tpetricek/FSharp.Formatting/issues/323
我在 ProjectScaffold 上有一个 project based 并且正在尝试获得一个好的构建。除了我在尝试生成文档时不断收到此错误。
---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target Duration
------ --------
Clean 00:00:00.0034230
AssemblyInfo 00:00:00.0089835
Build 00:00:04.1197276
CopyBinaries 00:00:00.0032325
RunTests 00:00:00.4153411
CleanDocs 00:00:00.0002847
Total: 00:00:12.2516707
Status: Failure
---------------------------------------------------------------------
1) System.Exception: generating help documentation failed
at FSI_0001.Build.generateHelp' (Boolean fail, Boolean debug) [0x00000] in <filename unknown>:0
at FSI_0001.Build+clo@218-18.Invoke (Microsoft.FSharp.Core.Unit _arg1) [0x00000] in <filename unknown>:0
at Fake.TargetHelper+targetFromTemplate@155[Microsoft.FSharp.Core.Unit].Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <filename unknown>:0
at Fake.TargetHelper.runSingleTarget (Fake.TargetTemplate`1 target) [0x00000] in <filename unknown>:0
到目前为止的疑难解答:
我专门针对该异常进行了搜索,得到了这个结果 - single google result. In that result that links here 似乎为某些依赖项添加了特定的版本挂钩,如下所示:
nuget FSharp.Formatting 2.8.0
nuget FSharpVSPowerTools.Core 1.7.0
它似乎对某些人有用,但对我不起作用。之后我仍然遇到同样的问题。也许我需要再次拉取依赖关系?我不确定。
我想做以下两种可能的事情之一:
- 解决问题。这当然是理想的。 :)
- 以某种方式删除 ProjectScaffold 的文档生成器。
执行 generate.fsx 文件我得到以下结果。
adron@ubuntu ~/C/sharpKataStringCalc> fsharpi docs/tools/generate.fsx
Copying file: /home/adron/Codez/sharpKataStringCalc/docs/output/img/logo-template.pdn
Copying file: /home/adron/Codez/sharpKataStringCalc/docs/output/img/logo.png
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/style.css
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/style_light.css
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/tips.js
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/img/github-blue.png
Copying styles and scripts: /home/adron/Codez/sharpKataStringCalc/docs/output/content/img/github.png
我能够 运行 使用此命令根据 Tomas 的建议构建文档:
fsharpi -d:HELP docs/tools/generate.fsx and fsharpi -d:REFERENCE docs/tools/generate.fsx
...并出现以下错误:
Processing the file 'docpage' failed
Source written to: '/tmp/tmp4a1e2cc4.tmp.cs'
Compilation errors:
- error: (0, 0) Assembly `FakeLib, Version=3.35.2.0, Culture=neutral, PublicKeyToken=null' references `FSharp.Core, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version number than imported assembly `FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
System.Exception: Generating HTML failed.
at FSharp.Literate.RazorRender.handleCompile[String] (System.String source, Microsoft.FSharp.Core.FSharpFunc`2 f) [0x00000] in <filename unknown>:0
at FSharp.Literate.RazorRender.ProcessFileModel[IDictionary`2] (System.Type modelType, System.Object model, Microsoft.FSharp.Core.FSharpOption`1 properties) [0x00000] in <filename unknown>:0
at FSharp.Literate.Templating.generateFile (Microsoft.FSharp.Core.FSharpOption`1 references, System.String contentTag, IEnumerable`1 parameters, Microsoft.FSharp.Core.FSharpOption`1 templateOpt, System.String output, IEnumerable`1 layoutRoots) [0x00000] in <filename unknown>:0
at FSharp.Literate.Templating.processFile (Microsoft.FSharp.Core.FSharpOption`1 references, FSharp.Literate.LiterateDocument doc, System.String output, FSharp.Literate.ProcessingContext ctx) [0x00000] in <filename unknown>:0
at FSharp.Literate.Literate.ProcessScriptFile (System.String input, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 output, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in <filename unknown>:0
at <StartupCode$FSharp-Literate>.$Main+processScriptFile@184.Invoke (System.String file, System.String output) [0x00000] in <filename unknown>:0
at Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.String].InvokeFast[Unit] (Microsoft.FSharp.Core.FSharpFunc`2 func, System.String arg1, System.String arg2) [0x00000] in <filename unknown>:0
at <StartupCode$FSharp-Literate>.$Main.processDirectory@199 (Microsoft.FSharp.Core.FSharpOption`1 format, Boolean processRecursive, Microsoft.FSharp.Core.FSharpFunc`2 processScriptFile, Microsoft.FSharp.Core.FSharpFunc`2 processMarkdown, System.String indir, System.String outdir) [0x00000] in <filename unknown>:0
at FSharp.Literate.Literate.ProcessDirectory (System.String inputDirectory, Microsoft.FSharp.Core.FSharpOption`1 templateFile, Microsoft.FSharp.Core.FSharpOption`1 outputDirectory, Microsoft.FSharp.Core.FSharpOption`1 format, Microsoft.FSharp.Core.FSharpOption`1 formatAgent, Microsoft.FSharp.Core.FSharpOption`1 prefix, Microsoft.FSharp.Core.FSharpOption`1 compilerOptions, Microsoft.FSharp.Core.FSharpOption`1 lineNumbers, Microsoft.FSharp.Core.FSharpOption`1 references, Microsoft.FSharp.Core.FSharpOption`1 fsiEvaluator, Microsoft.FSharp.Core.FSharpOption`1 replacements, Microsoft.FSharp.Core.FSharpOption`1 includeSource, Microsoft.FSharp.Core.FSharpOption`1 layoutRoots, Microsoft.FSharp.Core.FSharpOption`1 generateAnchors, Microsoft.FSharp.Core.FSharpOption`1 assemblyReferences, Microsoft.FSharp.Core.FSharpOption`1 processRecursive, Microsoft.FSharp.Core.FSharpOption`1 customizeDocument) [0x00000] in <filename unknown>:0
at FSI_0003.buildDocumentation () [0x00000] in <filename unknown>:0
at <StartupCode$FSI_0003>.$FSI_0003.main@ () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Stopped due to error
所以这里的事情变得有点有趣了。我将所有内容恢复到 generate.fsx 文件中的状态并进行了构建。它坏了,正如我怀疑上面的错误。然后,偶然我注意到我需要在 Ubuntu 14.04 本身上升级一些东西。所以我点击安装并开始下载大约 600+ MB 的补丁和更新。完成后,我不得不重新启动并且 fs 无法安装。所以我重新启动,进入安全模式,让 Ubuntu 运行 为操作系统上安装的所有内容重建一个包。完成后,我正常启动并启动 Visual Studio 代码和 bash 以重新开始解决此问题。
那是我进行构建并且一切都完美通过的时候。这个故事的寓意,似乎 Ubuntu 14.04 需要最新的补丁以及确保安装最新的单声道。似乎必须有一些单声道依赖,这是生成文档所必需的。
如果您想了解有关该问题的更多信息以及为解决该问题所做的工作,请在 Github 上查看此问题:https://github.com/tpetricek/FSharp.Formatting/issues/323