I'm building a project with a .fsx script using FAKE and MSBuild. When building with MSBuild, i give it several parameters:
Target "BuildProject" (fun _ ->
CleanDir ProjectDir
[ProjectPath]
|> MSBuild ProjectDir "Build" ["Configuration", "Release"; "Platform","x64"; "Verbosity", "quiet"; "TreatWarningsAsErrors", "true"]
|> ignore)
However, when i run my script, warnings are not treated as errors:
Build succeeded.
1 Warning(s)
0 Error(s)
Time Elapsed 00:00:11.36
Finished Target: BuildProject
Here is my commandline input:
Building project: MyProject/MyProject.fsproj
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
MyProject/MyProject.fsproj /t:Build /m /nodeReuse:False /p:RestorePackages="False"
/p:OutputPath="D:\MyProjectFolder\build\MyProject" /p:Configuration="Release" /p:Platform="x64"
/p:Verbosity="quiet" /p:TreatWarningsAsErrors="true" /logger:Fake.MsBuildLogger+ErrorLogger,"D:\MyProjectFolder\Project\packages\FAKE\tools\FakeLib.dll"
I'm not sure if the property is set correctly, but i've tried various versions by reading the documentation of FAKE and MSBuild.
From what i've read online, the property has to be given to the compiler, and will not work if the property is defined in a XML file.
Im using FAKE 4.64.11.
I want all warnings to be treated as errors, and not just specific warnings.
Hope someone can help.