question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use the WarningsAsErrors-Property of MSBuild

See original GitHub issue

Description

The WarningsAsErrors-Property is currently ignored by Fable. @nojaf asked about that on Gitter yesterday. He wanted to make the compilation fail on incomplete pattern matches.

Repro code

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <!--
    Warning FS0025: Incomplete pattern matches on this expression.
    -->
    <WarningsAsErrors>FS0025</WarningsAsErrors>
  </PropertyGroup>
</Project>

Expected and actual results

Fable should fail on a project with this setting, just as dotnet build does. But we currently generate a warning instead of an error.

Related information

  • Fable version (dotnet fable --version): 1.3.16

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
inosikcommented, May 10, 2018

See #1402.

2reactions
inosikcommented, Oct 3, 2018

See #1591.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# Compiler Options to report errors and warnings
Use TreatWarningsAsErrors to treat all warnings as errors. ... For other elements that affect warnings, see the Common MSBuild properties.
Read more >
Common MSBuild Project Properties
Specifies a list of warning codes to suppress by treating them as low-importance messages. Separate multiple warnings by semicolons. Note that ...
Read more >
WarningsAsErrors as a property #1907 - dotnet/msbuild
Been looking to add /warnaserror to Roslyn and one suggestion was to just set it globally using the MSBuild property <WarningsAsErrors> .
Read more >
MSBuild: How do i treat warnings as errors when building a ...
Im using FAKE 4.64.11. I want all warnings to be treated as errors, and not just specific warnings. Hope someone can help.
Read more >
Configuration of WarningsAsErrors for .NET build - Guides
Hello everyone! Using SonarScanner for MSBuild as a part of your .NET build pipeline may change your failing build to unexpected successful ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found