Browse Source

Treat warnings as errors repo-wide

A clean build currently has zero warnings; enforce that so new ones can't
accumulate unnoticed. Set TreatWarningsAsErrors in the root
Directory.Build.props rather than per project. ICSharpCode.ILSpyCmd keeps
its existing TreatWarningsAsErrors=false (project-level wins over the
imported default), and the three legacy net472 projects (the VS add-ins
and the installer builder) opt out explicitly since they only build on
Windows and aren't covered by the cross-platform CI that gates this.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3755/head
Siegfried Pammer 4 weeks ago
parent
commit
40a667fefb
  1. 7
      Directory.Build.props
  2. 2
      ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj
  3. 2
      ILSpy.AddIn/ILSpy.AddIn.csproj
  4. 2
      ILSpy.Installer/ILSpy.Installer.csproj

7
Directory.Build.props

@ -3,6 +3,13 @@
<NoWarn>$(NoWarn);NU1510</NoWarn> <NoWarn>$(NoWarn);NU1510</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!-- Warnings are errors repo-wide so a clean build stays clean; individual projects can opt
back out (e.g. ICSharpCode.ILSpyCmd sets TreatWarningsAsErrors=false) since project-level
properties override this imported default. -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<EnableNUnitRunner>true</EnableNUnitRunner> <EnableNUnitRunner>true</EnableNUnitRunner>
</PropertyGroup> </PropertyGroup>

2
ILSpy.AddIn.VS2022/ILSpy.AddIn.VS2022.csproj

@ -11,6 +11,8 @@
<Version>1.7.1.0</Version> <Version>1.7.1.0</Version>
<FileVersion>1.7.1.0</FileVersion> <FileVersion>1.7.1.0</FileVersion>
<LangVersion>9.0</LangVersion> <LangVersion>9.0</LangVersion>
<!-- Legacy net472 add-in: opt out of the repo-wide warnings-as-errors (Directory.Build.props). -->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<EnableDefaultItems>False</EnableDefaultItems> <EnableDefaultItems>False</EnableDefaultItems>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

2
ILSpy.AddIn/ILSpy.AddIn.csproj

@ -11,6 +11,8 @@
<Version>1.7.1.0</Version> <Version>1.7.1.0</Version>
<FileVersion>1.7.1.0</FileVersion> <FileVersion>1.7.1.0</FileVersion>
<LangVersion>9.0</LangVersion> <LangVersion>9.0</LangVersion>
<!-- Legacy net472 add-in: opt out of the repo-wide warnings-as-errors (Directory.Build.props). -->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<EnableDefaultItems>False</EnableDefaultItems> <EnableDefaultItems>False</EnableDefaultItems>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>

2
ILSpy.Installer/ILSpy.Installer.csproj

@ -4,6 +4,8 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<StartupObject>ILSpy.Installer.Builder</StartupObject> <StartupObject>ILSpy.Installer.Builder</StartupObject>
<!-- Legacy net472 installer builder: opt out of the repo-wide warnings-as-errors (Directory.Build.props). -->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

Loading…
Cancel
Save