我正在尝试在 Mac OSX 下使用 WebSharper 构建项目,但出现以下错误:
Target WebSharperCompile:
Compiling with WebSharper..
/Volumes/Data/Dev/Landmark_tools/packages/WebSharper.2.5.125.62/build/WebSharper.targets: error : Non-negative number required.
Parameter name: srcOffset at System.Buffer.BlockCopy (System.Array src, Int32 srcOffset, System.Array dst, Int32 dstOffset, Int32 count) [0x00000] in <filename unknown>:0
at Mono.Cecil.PE.Image.GetDebugHeader (System.Byte[]& header) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.GetDebugHeader (System.Byte[]& header) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader () [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ReadSymbols (ISymbolReader reader) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at IntelliFactory.WebSharper.Compiler.Loader.load (Microsoft.FSharp.Core.FSharpOption`1 flp, System.Byte[] bytes, Microsoft.FSharp.Core.FSharpOption`1 symbols, IntelliFactory.Core.AssemblyResolver aR) [0x00000] in <filename unknown>:0
at IntelliFactory.WebSharper.Compiler.Loader.LoadFile (System.String path) [0x00000] in <filename unknown>:0
Task "WebSharperTask" execution -- FAILED
Done building target "WebSharperCompile" in project "/Volumes/Data/Dev/Landmark_tools/RegionsInfo/RegionsInfo.fsproj".-- FAILED
Done building project "/Volumes/Data/Dev/Landmark_tools/RegionsInfo/RegionsInfo.fsproj".-- FAILED
Build FAILED.
Errors:
/Volumes/Data/Dev/Landmark_tools/RegionsInfo/RegionsInfo.fsproj (default targets) ->
/Volumes/Data/Dev/Landmark_tools/packages/WebSharper.2.5.125.62/build/WebSharper.targets (WebSharperCompile target) ->
/Volumes/Data/Dev/Landmark_tools/packages/WebSharper.2.5.125.62/build/WebSharper.targets: error : Non-negative number required.
Parameter name: srcOffset at System.Buffer.BlockCopy (System.Array src, Int32 srcOffset, System.Array dst, Int32 dstOffset, Int32 count) [0x00000] in <filename unknown>:0
at Mono.Cecil.PE.Image.GetDebugHeader (System.Byte[]& header) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.GetDebugHeader (System.Byte[]& header) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader () [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ReadSymbols (ISymbolReader reader) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleReader.ReadSymbols (Mono.Cecil.ModuleDefinition module, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleReader.CreateModuleFrom (Mono.Cecil.PE.Image image, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0
at IntelliFactory.WebSharper.Compiler.Loader.load (Microsoft.FSharp.Core.FSharpOption`1 flp, System.Byte[] bytes, Microsoft.FSharp.Core.FSharpOption`1 symbols, IntelliFactory.Core.AssemblyResolver aR) [0x00000] in <filename unknown>:0
at IntelliFactory.WebSharper.Compiler.Loader.LoadFile (System.String path) [0x00000] in <filename unknown>:0
0 Warning(s)
1 Error(s)
我可以在 Windows 下构建相同的项目而没有任何问题。在 Windows 下,我可以简单地执行msbuild
或指定配置msbuild /p:Configuration=Release
,甚至是 Fake 编译器。在 Mac OSX 下,无论我尝试使用什么(使用 xbuild 或 Fake),我总是遇到同样的错误。上次我能够使用发布模式构建项目,但在这里它也不起作用。
我在 github 下托管了这个项目:https ://github.com/MangelMaxime/BugReport
我知道不推荐,但最好有相同的条件......