gpt4 book ai didi

f# - VS2013每次编译FSharp项目

转载 作者:行者123 更新时间:2023-12-04 19:06:19 25 4
gpt4 key购买 nike

我修复了一些导致项目重建的问题,主要是在 C#/C++ 项目中(将副本始终更改为如果更新,则删除对丢失文件的引用等)。我通过将 MSBuild 输出更改为诊断并分析输出来做到这一点。

但是我未能对解决方案中的非常简单的 FSharp 项目应用相同的解决方法。输出没有显示任何可疑的东西。项目本身是一个单文件项目。

最小输出:

1>------ Build started: Project: FSharpProject, Configuration: Debug Any CPU ------
1> "C:\Project\Source\.nuget\NuGet.exe" install "C:\Project\Source\FSharpProject\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\Project\Source\ "
1> All packages listed in packages.config are already installed.
1> FSharpProject -> C:\Project\Source\FSharpProject\bin\Debug\FSharpProject.dll
2>------ Build started: Project: FSharpProject.Tests, Configuration: Debug Any CPU ------
2> "C:\Project\Source\.nuget\NuGet.exe" install "C:\Project\Source\FSharpProject.Tests\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\Project\Source\ "
2> All packages listed in packages.config are already installed.
2> FSharpProject.Tests -> C:\Project\Source\FSharpProject.Tests\bin\Debug\FSharpProject.Tests.dll
========== Build: 2 succeeded, 0 failed, 16 up-to-date, 0 skipped ==========

诊断输出很大,但看起来没有显示重建原因。

更新:

我用两个项目创建了一个简单的解决方案:C# 和 F#。

虽然 C# 项目报告为最新,但始终为 F# 项目执行构建操作。这只是 F# 项目的正常行为吗?
1>------ Build started: Project: FSharpProject, Configuration: Debug Any CPU ------
1>Target "_CheckForInvalidConfigurationAndPlatform" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (entry point):
1>Target "BeforeBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Build" depends on it):
1>Target "BuildOnlySettings" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "GetFrameworkPaths" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.NetFramework.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareForBuild" depends on it):
1>Target "GetReferenceAssemblyPaths" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareForBuild" depends on it):
1>Target "PrepareForBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "BeforeResolveReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "AssignProjectConfiguration" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "_SplitProjectReferencesByFileExistence" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveProjectReferences" depends on it):
1>Target "ResolveProjectReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "GetInstalledSDKLocations" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveSDKReferences" depends on it):
1>Target "ResolveSDKReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveAssemblyReferences" depends on it):
1>Target "ExpandSDKReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveAssemblyReferences" depends on it):
1>Target "ResolveAssemblyReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "AfterResolveReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "ImplicitlyExpandDesignTimeFacades" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.NetFramework.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResolveReferences" depends on it):
1>Target "ResolveReferences" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "ValidationExtension" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WorkflowBuildExtensions.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "ExpressionBuildExtension" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WorkflowBuildExtensions.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "AfterMarkupCompilePass1" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "FileClassification" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "AssignTargetPaths" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResourceNames" depends on it):
1>Target "SplitResourcesByCulture" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResourceNames" depends on it):
1>Target "CreateCustomManifestResourceNames" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResourceNames" depends on it):
1>Target "PrepareResourceNames" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "BeforeResGen" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResGen" depends on it):
1>Target "CoreResGen" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResGen" depends on it):
1>Target "AfterResGen" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "ResGen" depends on it):
1>Target "ResGen" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "PrepareRdlFiles" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\ReportingServices\Microsoft.ReportingServices.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CompileRdlFiles" depends on it):
1>Target "CompileRdlFiles" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\ReportingServices\Microsoft.ReportingServices.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareResources" depends on it):
1>Target "PrepareResources" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "_SetEmbeddedWin32ManifestProperties" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "SetWin32ManifestProperties" depends on it):
1>Target "SetWin32ManifestProperties" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "_GenerateCompileInputs" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "GenerateTargetFrameworkMonikerAttribute" in file "C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "BeforeCompile" depends on it):
1> Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>Target "BeforeCompile" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "DesignTimeXamlMarkupCompilation" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreCompile" depends on it):
1>Target "DesignTimeMarkupCompilation" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreCompile" depends on it):
1>Target "CoreCompile" in file "C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1> Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
1>Target "AfterCompile" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "SetBuildInfoDefaults" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "DeleteBuildInfoFile" depends on it):
1>Target "DeleteBuildInfoFile" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "DeleteBuildInfoResource" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\BuildInfo\Microsoft.VisualStudio.ReleaseManagement.BuildInfo.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "AfterCompileWinFX" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "_AfterCompileWinFXInternal" depends on it):
1>Target "_AfterCompileWinFXInternal" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "CodeContractReferenceAssembly" in file "C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v12.0\Microsoft.CodeContracts.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Compile" depends on it):
1>Target "Compile" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "_GenerateSatelliteAssemblyInputs" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CreateSatelliteAssemblies" depends on it):
1>Target "CreateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "GetTargetPath" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "_CopyFilesMarkedCopyLocal" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CopyFilesToOutputDirectory" depends on it):
1>Target "GetCopyToOutputDirectoryXamlAppDefs" in file "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "GetCopyToOutputDirectoryItems" depends on it):
1>Target "GetCopyToOutputDirectoryItems" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "_CopySourceItemsToOutputDirectory" depends on it):
1>Target "_CopySourceItemsToOutputDirectory" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CopyFilesToOutputDirectory" depends on it):
1>Target "_CheckForCompileOutputs" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CopyFilesToOutputDirectory" depends on it):
1>Target "CopyFilesToOutputDirectory" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "PrepareForRun" depends on it):
1> FSharpProject -> c:\Projects\TestFSharpBuild\FSharpProject\bin\Debug\FSharpProject.dll
1>Target "PrepareForRun" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "IncrementalClean" depends on it):
1>Target "IncrementalClean" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "CoreBuild" depends on it):
1>Target "CoreBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Build" depends on it):
1>Target "AfterBuild" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (target "Build" depends on it):
1>Target "Build" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "c:\Projects\TestFSharpBuild\FSharpProject\FSharpProject.fsproj" (entry point):
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

最佳答案

这只是如何报告整体构建结果的问题。也就是说,即使它说它构建(并且 F# 项目从不增加“最新”类别中的计数)它实际上并没有调用编译器,或者您会在日志中看到带有 fsc.exe 的一行某处。它只是调用构建目标,然后检测输出已经是最新的事实。这仍然可以说是一个错误,但不是一个非常重要的错误......

关于f# - VS2013每次编译FSharp项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23424815/

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