You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An fsproj that builds correctly on MSBuild 16 (the version with Visual Studio 2019) fails to build on MSBuild 17 (the version with Visual Studio 2022).
I found this error whilst investigating why the csproj that referenced this project in our solution was failing to build because it was unable to find types from the fsproj. On isolating just the fsproj and running MSBuild against that I received the error:
MSB4057: The target "Build" does not exist in the project.
Repro steps
The fsproj is a .Net Standard 2.0 project. The fsproj looks like:
This seems to be an issue with the Build Tools installation for VS2022, installing Community edition results in an MSBuild that recognises the F# projects and builds correctly.
An fsproj that builds correctly on MSBuild 16 (the version with Visual Studio 2019) fails to build on MSBuild 17 (the version with Visual Studio 2022).
I found this error whilst investigating why the csproj that referenced this project in our solution was failing to build because it was unable to find types from the fsproj. On isolating just the fsproj and running MSBuild against that I received the error:
MSB4057: The target "Build" does not exist in the project.
Repro steps
The fsproj is a .Net Standard 2.0 project. The fsproj looks like:
I'm running the command:
MSBuild.exe /bl:W:\stuff\tmpFC82.tmp.binlog /clp:ForceConsoleColor /m:8 /nodeReuse:False /p:RestorePackages=False /p:Optimize=True /p:DebugSymbols=True /p:Configuration=Release /restore /t:Build /v:m "W:\stuff\src\mms\MMS.Text.Interpolate\MMS.Text.Interpolate.fsproj"
We have the Visual Studio Build Tools for 2019 and 2022 installed on the server and both have the F# compiler installed.
If I run identical commands against the same code using 2019 it succeeds and 2022 it returns this failure.
Expected behavior
The build to run and succeed
Actual behavior
MSB4057: The target "Build" does not exist in the project.
Known workarounds
I attempted adding
<FSharpPreferNetFrameworkTools>true</FSharpPreferNetFrameworkTools>
but it made no difference.Related information
The text was updated successfully, but these errors were encountered: