Closed
Description
Description
Linting a .NET Framework project throws an error:
Lint failed while analysing project C:\Users\luke\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.fsproj.
Failed with: error getting msbuild info: internal error, more info returned than expected MSBuildFailed
Repro steps
- Create a new .NET Framework F# project (e.g. in Visual Studio 2017: file -> new -> project -> Visual F# -> Console Application (.NET Framework))
- Run fsharplint against the newly created project, e.g:
> dotnet fsharplint -f "C:\Users\luke\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.fsproj"
Expected behavior
Lint should run successfully, as is the case when repeating the above steps but creating a .NET Core project instead:
> dotnet fsharplint -f "C:\Users\luke\source\repos\ConsoleApp1\ConsoleApp1\ConsoleApp1.fsproj"
========== Linting C:\Users\luke\source\repos\ConsoleApp1\ConsoleApp1\obj\Debug\netcoreapp2.1\ConsoleApp1.AssemblyInfo.fs ==========
========== Finished: 0 warnings ==========
========== Linting C:\Users\luke\source\repos\ConsoleApp1\ConsoleApp1\Program.fs ==========
========== Finished: 0 warnings ==========
========== Summary: 0 warnings ==========
Actual behavior
The following error is displayed:
Lint failed while analysing project C:\Users\luke\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.fsproj.
Failed with: error getting msbuild info: internal error, more info returned than expected MSBuildFailed
(1,
("C:\Users\luke\source\repos\ConsoleApplication1\ConsoleApplication1",
"dotnet",
"msbuild C:\Users\luke\source\repos\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\Users\luke\AppData\Local\Temp\tmpCDE5.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\Users\luke\AppData\Local\Temp\tmpCDE6.tmp.GetResolvedProjectReferences.txt /p:CustomAfterMicrosoftCommonTargets=C:\Users\luke\AppData\Local\Temp\tmpCDE7.tmp.proj-info.hook.targets /p:CustomAfterMicrosoftCommonCrossTargetingTargets=C:\Users\luke\AppData\Local\Temp\tmpCDE7.tmp.proj-info.hook.targets /nologo /verbosity:quiet"))
Stack trace: at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1645.Invoke(String message)
at FSharpLint.Application.Lint.lintProject(OptionalLintParameters optionalParams, String projectFilePath) in C:\projects\fsharplint-231\src\FSharpLint.Core\Application\Lint.fs:line 470
at FSharpLint.Console.Program.startWithArguments@129.Invoke(Argument arg) in C:\projects\fsharplint-231\src\FSharpLint.Console\Program.fs:line 130
Known workarounds
Using .NET Core instead of .NET Framework.
Related information
- Windows 10
- .NET Framework v4.5.2