Skip to content

clear warnings in foundation pipeline #5645

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 3 commits into from
Jul 28, 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
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ steps:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: /binaryLogger:$(ob_outputDirectory)\binlogs\WindowsAppRuntimeInstall.$(buildPlatform).$(buildConfiguration).binlog
${{ if eq( parameters.runStaticAnalysis, 'true') }}:
createLogFile: true

# The VSBuild@1 task above seems to be able to do inline PREfast scanning with the EO-compliant ruleset now. So, we don't seem to
# need the following any more. Commenting it out for now and observe a bit more. Remove it when we feel comfortable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ steps:
platform: 'Any CPU'
configuration: '$(buildConfiguration)'
msBuildArgs: '/p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /binaryLogger:$(ob_outputDirectory)\binlogs\StandaloneVSIX.build.binlog'
${{ if eq( parameters.runStaticAnalysis, 'true') }}:
createLogFile: true

- ${{ if eq(parameters.runStaticAnalysis, 'true') }}:
- task: SDLNativeRules@3
Expand Down Expand Up @@ -141,8 +139,6 @@ steps:
platform: 'Any CPU'
configuration: '$(buildConfiguration)'
msBuildArgs: '/restore /p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /p:Deployment="Component" /binaryLogger:$(ob_outputDirectory)\binlogs\ComponentVSIX.build.binlog'
${{ if eq( parameters.runStaticAnalysis, 'true') }}:
createLogFile: true

- ${{ if eq(parameters.runStaticAnalysis, 'true') }}:
- task: SDLNativeRules@3
Expand Down
33 changes: 29 additions & 4 deletions dev/VSIX/Shared/WizardImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ public partial class NuGetPackageInstaller : IWizard
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
ThreadHelper.ThrowIfNotOnUIThread();
_componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
_componentModel = ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel)) as IComponentModel;
if (_componentModel == null)
{
System.Diagnostics.Debug.WriteLine("Warning: Could not obtain IComponentModel service.");
}

_waitDialog = ServiceProvider.GlobalProvider.GetService(typeof(SVsThreadedWaitDialog)) as IVsThreadedWaitDialog2;
if (_waitDialog == null)
{
System.Diagnostics.Debug.WriteLine("Warning: Could not obtain IVsThreadedWaitDialog2 service.");
}

if (_componentModel != null)
{
_nugetProjectUpdateEvents = _componentModel.GetService<IVsNuGetProjectUpdateEvents>();
Expand Down Expand Up @@ -68,19 +78,27 @@ private async Task InstallNuGetPackagesAsync()
await ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
int canceled; // This variable will store the status after the dialog is closed
int canceled = 0; // Initialize as not canceled

// Start the package installation task but do not await it here
var installationTask = StartInstallationAsync();

// Start the threaded wait dialog
_waitDialog.StartWaitDialog(null, "Installing NuGet packages into project...", null, null, "Operation in progress...", 0, false, true);
if (_waitDialog != null)
{
_waitDialog.StartWaitDialog(null, "Installing NuGet packages into project...", null, null, "Operation in progress...", 0, false, true);
}

// Now await the installation task to complete
await installationTask;

// Once the installation is complete, end the wait dialog
_waitDialog.EndWaitDialog(out canceled);
if (_waitDialog != null)
{
_waitDialog.EndWaitDialog(out canceled);
}
// If _waitDialog is null, canceled remains 0 (not canceled)

// Check if the process was canceled before proceeding
if (canceled == 0) // If not canceled, finalize the process
{
Expand All @@ -92,6 +110,13 @@ await ThreadHelper.JoinableTaskFactory.RunAsync(async () =>

private async Task StartInstallationAsync()
{
if (_componentModel == null)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
LogError("ComponentModel service is not available.");
return;
}

IVsPackageInstaller installer = _componentModel.GetService<IVsPackageInstaller>();
if (installer == null)
{
Expand Down
2 changes: 1 addition & 1 deletion installer/dev/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace winrt;

using namespace WindowsAppRuntimeInstaller::Console;

int wmain(int argc, wchar_t *argv[])
int __cdecl wmain(int argc, wchar_t *argv[])
{
init_apartment();

Expand Down
8 changes: 4 additions & 4 deletions test/StaticValidationTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public string SignTool

class CertValidation
{
public string File;
public string IssuedToName;
public string ExtraSignToolFlags; // Extra flags to pass to signtool.exe.
public int ValidationCount = 0; // This counter is to ensure we found the files we were looking for.
public string File { get; set; }
public string IssuedToName { get; set; }
public string ExtraSignToolFlags { get; set; } // Extra flags to pass to signtool.exe.
public int ValidationCount { get; set; } = 0; // This counter is to ensure we found the files we were looking for.
}

class Program
Expand Down