-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[dotnet-sdk-10.0.100-alpha.1.25057.15] Fail to open folder in WinQuickLook with error "System.InvalidCastException: Unable to cast object of type 'System.__ComObject' to type 'Windows.Win32.UI.Shell.IShellView'". #112371
Comments
This issue seems to be entirely CsWin32 related. |
As in the repro case does not use WPF at all, there is no reason why this should be filed in this repo. |
@AaronRobinsonMSFT may have a suggestion here. |
Hi @AaronRobinsonMSFT, could you please have a look at this issue and let us know if any suggestions? Thanks |
@Junjun-zhao I'll take a look today. |
Tagging subscribers to this area: @dotnet/interop-contrib |
@Junjun-zhao Thanks for reporting this issue. This was introduced in #105965. I will put up a fix shortly. |
Thanks @AaronRobinsonMSFT for the quick fix. May I know whether this is a blocker for .NET 10 Preview 1 and the fix will be merged into the .NET 10 Preview1? |
@Junjun-zhao Sorry, this is not a preview blocker. You should be able to get around this issue by removing the IOle interface from the definition of IShellView. I know this is being done via CsWin32 so that might be difficult, but the workaround is to not have your COM interface implement any other interface. |
Verified on build dotnet-sdk-10.0.100-preview.2.25122.2, this issue has been fixed. |
Description
When run the 3rd party application with the latest .NET 10 build, it was no response to open folder. After investigation, we discovered this error:
System.InvalidCastException: Unable to cast object of type 'System.__ComObject' to type 'Windows.Win32.UI.Shell.IShellView'
.Reproduction Steps
App Repro Steps:
2.Change the "WinQuickLook.App.runtimeconfig.json" file to let the app run against with
dotnet-sdk-10.0.100-alpha.1.25057.15.
Expected Result:
Pop up window.
Actual Result:
No window show.
Minimal Repro steps (Demo attached: WpfAppDemo.zip):
Expected behavior
Launch successfully.
Actual behavior
Launch failed with error:
System.InvalidCastException: Unable to cast object of type 'System.__ComObject' to type 'Windows.Win32.UI.Shell.IShellView'
.Regression?
Yes
Verify Scenarios:
1). Windows 10 22H2 AMD64 + dotnet-sdk-9.0.102: Pass
2). Windows 10 22H2 AMD64 + dotnet-sdk-10.0.100-alpha.1.25057.15: Fail
Known Workarounds
No response
Impact
No response
Configuration
Application Name: WinQuickLook
OS: Windows 10 22H2
CPU: X64
.NET Build Number: dotnet-sdk-10.0.100-alpha.1.25057.15
App & Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2340552
Github Link: https://github.com/shibayan/WinQuickLook
Dotnet info:
Other information
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: