I have a project file (*.fsproj). It can be built successfully with Visual Studio 2019 via "Build" menu.
But when invoking "Build Tools for Visual Studio 2019" (link), with the following command:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" ".\src\[ProjectFolder]\[ProjectName].fsproj" /t:Build /p:Configuration=Release /p:Platform="Any CPU"
It raised an error error MSB4057: The target "Build" does not exist in the project.
.
The project file:
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Version>2.0.0.0</Version>
<FileVersion>2.0.0.0</FileVersion>
<Configurations>Debug;Release;[...]</Configurations>
</PropertyGroup>
<ItemGroup>
<Compile Include="[File1].fs" />
<Compile Include="[File2].fs" />
<Compile Include="[File3].fs" />
</ItemGroup>
<ItemGroup>
<None Include="paket.references" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
Note: To keep names confidential, I replaced them with [].
Question: Is there anyway to make MSBuild behave exactly like what is done in Visual Studio? I'm attempting to build *.SLN (consisting of many *.fsproj and *.csproj), without Visual Studio IDE.
I can force Visual Studio to spit out more logging info when it builds (as followed), but the logging info is overwhelming and I don't know what to look for.