Skip to content

Don't use ArgumentList when creating COM object as it's not applicable to the COM parameter set - #15915

Merged
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:comobj
Aug 14, 2021
Merged

Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:comobj

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

PR Summary

We ran into a .NET bug in .NET 6 preview.7 when creating a COM object with Activator.CreateInstance. The bug is triggered when passing an empty arguments array along with the COM type to CreateInstance (see the bug here). The workaround is to not passing in the empty argument array.

When looking at our New-Object code with Aditya Patwardhan (@adityapatwardhan), we found -ArgumentList is not even in the COM parameter set, but the COM object creation code is still using ArgumentList. That's not right and is fixed in this PR.

PR Checklist

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Aug 13, 2021
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 05e6413 into PowerShell:master Aug 14, 2021
xtqqczze pushed a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Aug 20, 2021
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.9 has been released which incorporates this pull request.:tada:

Handy links:

@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.10 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants