-
Notifications
You must be signed in to change notification settings - Fork 200
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
WUApi error -> System.InvalidCastException : Specified cast is not valid. #496
Comments
…tion of Windows Update when empty collection provided.
Do you know if this a poor response failure code to assigning an empty collection? |
@dahall no, two element to download. Let me share you the screenshot and a full test code. Variables screenshot:
|
Thanks for this. Oddest error ever. I've been directly implementing CoClass's over interfaces for 20 years. This was the first time an assignment of an interface created by a CoClass has caused a cast exception. For just IUpdateCollection, you have to create it now with IUpdateCollection coll = (IUpdateCollection)new UpdateCollectionClass(); Then it all works. You can pick up the pre-release builds from AppVeyor (see project README.md for instructions). I'll likely be releasing this version this coming week. |
Thank you very much, @dahall. I'll use the AppVeyor build for my Shell32 @ WinUI3 stuff asap, too. I'll let you know when I get unexpected behaviour. 👍 |
Hello. I run the test WUApiTests.TestInstaller and it throws:
The method set_Updates on IUpdateDownloader from Vanara.PInvoke.WUApi causing the issue.
I test it code and give me the same error:
SAlu2s
The text was updated successfully, but these errors were encountered: