Make sure that the signing of .js and .vbs files with the AzureSignToolSigner uses STA context.#881
Merged
dtivel merged 5 commits intodotnet:mainfrom Apr 20, 2026
Merged
Conversation
a71f3e7 to
4504884
Compare
dtivel
reviewed
Jul 27, 2025
dtivel
reviewed
Jul 27, 2025
dtivel
reviewed
Jul 27, 2025
dtivel
reviewed
Jul 27, 2025
dtivel
added a commit
that referenced
this pull request
Mar 27, 2026
Address review concerns on PR #881: - Run only the synchronous SignFile COM call on a dedicated STA thread (via RunOnStaThread<T>), not the entire async SignAsync. This avoids the need for a custom SynchronizationContext and ensures retries also run on STA threads. - Partition STA-required files (.js, .vbs) from the Parallel.ForEachAsync loop. STA files are signed sequentially to avoid blocking ThreadPool threads via thread.Join(). Non-STA files continue to be signed in parallel as before. - Use HashSet<string> with StringComparer.OrdinalIgnoreCase for case-insensitive extension matching. - Unseal AzureSignToolSigner and extract SignFileCore as internal virtual to enable test substitution for apartment state verification. - Add tests proving .vbs/.js files are signed on STA threads, .dll files on MTA threads, and mixed batches are correctly partitioned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
@dlemstra, I addressed the feedback in this commit. Do you want to apply this commit and rebase on latest main? |
4504884 to
4dec1fa
Compare
dlemstra
pushed a commit
to dlemstra/sign
that referenced
this pull request
Apr 6, 2026
Address review concerns on PR dotnet#881: - Run only the synchronous SignFile COM call on a dedicated STA thread (via RunOnStaThread<T>), not the entire async SignAsync. This avoids the need for a custom SynchronizationContext and ensures retries also run on STA threads. - Partition STA-required files (.js, .vbs) from the Parallel.ForEachAsync loop. STA files are signed sequentially to avoid blocking ThreadPool threads via thread.Join(). Non-STA files continue to be signed in parallel as before. - Use HashSet<string> with StringComparer.OrdinalIgnoreCase for case-insensitive extension matching. - Unseal AzureSignToolSigner and extract SignFileCore as internal virtual to enable test substitution for apartment state verification. - Add tests proving .vbs/.js files are signed on STA threads, .dll files on MTA threads, and mixed batches are correctly partitioned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
Thanks for helping out with this PR @dtivel! I have updated the pull request. |
Collaborator
|
@dlemstra, can you rebase on latest main one more time? The last build failed for some "infrastructure" issue. |
…olSigner uses STA context.
Address review concerns on PR dotnet#881: - Run only the synchronous SignFile COM call on a dedicated STA thread (via RunOnStaThread<T>), not the entire async SignAsync. This avoids the need for a custom SynchronizationContext and ensures retries also run on STA threads. - Partition STA-required files (.js, .vbs) from the Parallel.ForEachAsync loop. STA files are signed sequentially to avoid blocking ThreadPool threads via thread.Join(). Non-STA files continue to be signed in parallel as before. - Use HashSet<string> with StringComparer.OrdinalIgnoreCase for case-insensitive extension matching. - Unseal AzureSignToolSigner and extract SignFileCore as internal virtual to enable test substitution for apartment state verification. - Add tests proving .vbs/.js files are signed on STA threads, .dll files on MTA threads, and mixed batches are correctly partitioned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4dec1fa to
04a1ad1
Compare
Collaborator
Collaborator
Author
|
Thanks for all the help again! It looks like we are ready to merge? |
dtivel
approved these changes
Apr 19, 2026
mcumming
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #880