From 6ab62e5bc6cfd1c3941f9c74106e2987042c52e1 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 4 Aug 2025 13:57:58 +1000 Subject: [PATCH 1/5] Treat warnings as errors in release builds Lately we've started seeing warnings creeping into the codebase. These should be caught by CI and prevented. To make it easier to reproduce CI behaviour locally, this setting is enabled for release builds. If CI fails and you want to recreate the error locally, switch to release mode and build. --- Directory.Build.props | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 0a48b86538..58b71703f4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -44,6 +44,11 @@ full + + + true + + From 412c5b0286b23100c3ad58d1d484017c9eafe482 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 4 Aug 2025 14:09:49 +1000 Subject: [PATCH 2/5] Remove redundant using declaration --- .../Mocks/IUnconfiguredProjectVsServicesFactory.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Mocks/IUnconfiguredProjectVsServicesFactory.cs b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Mocks/IUnconfiguredProjectVsServicesFactory.cs index 5199fb3bc8..ef5c14392e 100644 --- a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Mocks/IUnconfiguredProjectVsServicesFactory.cs +++ b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Mocks/IUnconfiguredProjectVsServicesFactory.cs @@ -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; From 896550c52085cf841bdebc999789c5bcdb77280f Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 4 Aug 2025 14:10:03 +1000 Subject: [PATCH 3/5] Update API files --- .../PublicAPI/net472/PublicAPI.Shipped.txt | 8 +++++++- .../PublicAPI/net472/PublicAPI.Unshipped.txt | 6 ------ .../PublicAPI/net9.0/PublicAPI.Shipped.txt | 8 +++++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Shipped.txt b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Shipped.txt index 86c634eb79..b8a0a17cae 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Shipped.txt +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Shipped.txt @@ -215,4 +215,10 @@ Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadUpdateApplier Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.HotReloadStateChangedAsync -> Microsoft.VisualStudio.Threading.AsyncEventHandler! Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.IsProjectInHotReload.get -> bool -Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.SetHotReloadStateAsync(bool isInHotReload) -> System.Threading.Tasks.Task! \ No newline at end of file +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! +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! diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Unshipped.txt b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Unshipped.txt index afb9055a55..e69de29bb2 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Unshipped.txt +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net472/PublicAPI.Unshipped.txt @@ -1,6 +0,0 @@ -Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager -Microsoft.VisualStudio.ProjectSystem.HotReload.IProjectHotReloadBuildManager.BuildProjectAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! -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.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! \ No newline at end of file diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt index cd606dcf93..78a51cd3cc 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt @@ -209,4 +209,10 @@ Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadUpdateApplier Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.HotReloadStateChangedAsync -> Microsoft.VisualStudio.Threading.AsyncEventHandler Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.IsProjectInHotReload.get -> bool -Microsoft.VisualStudio.ProjectSystem.VS.HotReload.IProjectHotReloadNotificationService.SetHotReloadStateAsync(bool isInHotReload) -> System.Threading.Tasks.Task \ No newline at end of file +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 +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 From fde1300ab49721fb874e9f5fce757b907f9c01b2 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 4 Aug 2025 14:23:57 +1000 Subject: [PATCH 4/5] Allow obsolete API usage warnings The XAML code generator produces code that uses `XamlServices`, which is obsolete. Unfortunately there doesn't seem to be a way to suppress these warnings without modifying the code generator. Therefore, we allow just this one warning to be not treated as an error. --- Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 58b71703f4..5caf712761 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -47,6 +47,8 @@ true + + CS0618 From 24a291d33a9a501bbb927a175478a3c9c4bbcf03 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Tue, 5 Aug 2025 11:08:13 +1000 Subject: [PATCH 5/5] Fix warnings --- .../PublicAPI/net9.0/PublicAPI.Shipped.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt index 78a51cd3cc..eee3a0542a 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/PublicAPI/net9.0/PublicAPI.Shipped.txt @@ -216,3 +216,5 @@ 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 \ No newline at end of file