gpt4 book ai didi

F# (mono) for VS Code on MacOS : bugs

转载 作者:行者123 更新时间:2023-12-01 12:55:13 26 4
gpt4 key购买 nike

我正在尝试在 MacOS (Sierra 10.12.6) 上将 F# 与 VS Code (v1.17.2) 结合使用我想我已经安装了最新版本的 Mono 和 .NET SDK

我正在尝试构建此处描述的简单项目作为测试 https://github.com/s952163/FSharpVSCode

在默认安装后,我可以执行 MSBuild 并在终端中运行该程序,没有任何问题。然而在那个阶段,(1) Intellisense 工作不正常,不识别 Deedle(2) 在 F# 资源管理器中它会说'TestProject1.fsproj(加载失败)右键单击时出现此错误

Error: MSBuild failed with exitCode 1 Working Directory: '/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1' Exe Path: 'dotnet' Args: 'msbuild /Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmp52c377ed.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmpfe4a2c2.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmpfe4a2c2.tmp.GetProperties.txt /nologo /verbosity:quiet' Log: writing helper target file in '/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/obj/TestProject1.fsproj.proj-info.targets' /usr/local/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj]

为了尝试解决这个问题,我输入了以下内容

export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/

但更糟糕的是,在那之后,项目不再在 VS Code 中构建,因为我在尝试 (Cmd-Shift-P) MSBuild: Build Project

时得到了这个输出

/usr/local/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj]

截图在这里 https://imgur.com/KtMM2Bu

最佳答案

VS Code 环境在调用它时传递给 msbuild,因此在 VS Code 启动时设置环境变量可以达到目的:

FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/代码。

关于F# (mono) for VS Code on MacOS : bugs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47027898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com