Skip to content

Treat warnings as errors in release builds #9719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
<DebugType Condition="'$(OfficialBuild)' != 'true' AND '$(CIBuild)' != 'true' AND '$(BuildingInsideVisualStudio)' == 'true'">full</DebugType>
</PropertyGroup>

<!-- Treat warnings as errors in release builds, so they're caught during CI. -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Skip just this one as unfortunately there's no way to suppress the warnings about use of obsolete XamlServices in generated rule file code. -->
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
</PropertyGroup>

<!-- General -->
<PropertyGroup>
<!-- Variable used for executing a PowerShell command with arguments for the MSBuild/commandline environment. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadLaunchProvider.L
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent2
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent2.CreateHotReloadSession(string! id, int variant, string? runtimeVersion, Microsoft.VisualStudio.ProjectSystem.ConfiguredProject! configuredProject, Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadLaunchProvider? launchProvider, Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager? buildManager, Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSessionCallback! callback, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile! launchProfile, Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions debugLaunchOptions) -> Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSession!
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgentExtensions
static Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgentExtensions.CreateHotReloadSession(this Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent! agent, string! id, int variant, Microsoft.VisualStudio.ProjectSystem.ConfiguredProject! configuredProject, Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSessionCallback! callback, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile! launchProfile, Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions debugLaunchOptions) -> Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSession!
static Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgentExtensions.CreateHotReloadSession(this Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent! agent, string! id, int variant, Microsoft.VisualStudio.ProjectSystem.ConfiguredProject! configuredProject, Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSessionCallback! callback, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile! launchProfile, Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions debugLaunchOptions) -> Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSession!
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,12 @@ Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadUpdateApplier
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.HotReloadStateChangedAsync -> Microsoft.VisualStudio.Threading.AsyncEventHandler<bool>
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.IsProjectInHotReload.get -> bool
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.SetHotReloadStateAsync(bool isInHotReload) -> System.Threading.Tasks.Task
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.SetHotReloadStateAsync(bool isInHotReload) -> System.Threading.Tasks.Task
Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager
Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager.BuildProjectAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<bool>
Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadLaunchProvider
Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadLaunchProvider.LaunchWithProfileAsync(Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions launchOptions, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile profile, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent2
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent2.CreateHotReloadSession(string id, int variant, string runtimeVersion, Microsoft.VisualStudio.ProjectSystem.ConfiguredProject configuredProject, Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadLaunchProvider launchProvider, Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager buildManager, Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSessionCallback callback, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile launchProfile, Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions debugLaunchOptions) -> Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSession
Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgentExtensions
static Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgentExtensions.CreateHotReloadSession(this Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadAgent agent, string id, int variant, Microsoft.VisualStudio.ProjectSystem.ConfiguredProject configuredProject, Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSessionCallback callback, Microsoft.VisualStudio.ProjectSystem.Debug.ILaunchProfile launchProfile, Microsoft.VisualStudio.ProjectSystem.Debug.DebugLaunchOptions debugLaunchOptions) -> Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadSession
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

using Microsoft.VisualStudio.ProjectSystem.HotReload;
using Microsoft.VisualStudio.Shell.Interop;

namespace Microsoft.VisualStudio.ProjectSystem.VS;
Expand Down
Loading