Crash 'Unable to cast object of type 'System.__ComObject' to type 'ITfThreadMgr'.'
See original GitHub issue- .NET Core Version: 3.1
- Windows version: (
Windows 10 Pro 19043.1645
) - Does the bug reproduce also in WPF for .NET Framework 4.8?: Unknow
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)? No.
- Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.
Problem description: Unknown cause. 1.We used WebView2 (1.3.153.51) in our project, We are using WebView2 when the crash happens. I’m not sure if it has anything to do with this. 2.Is it possible that the problem is caused by the Chinese input ?
Actual behavior:
App crash at Dispatcher.GetMessagePump()
It looks like the ‘threadManager’ value is of the wrong type?
Expected behavior:
Minimal repro:
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:33 (22 by maintainers)
Top Results From Across the Web
Unable to cast COM object of type 'System.__ComObject' ...
Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricKeyValueStoreReplica8'. This operation failed because the ...
Read more >VS2015: Unable to cast COM object of type 'System. ...
This is usually caused by a mismatch between the service code + nuget packages and the software version of the cluster.
Read more >Unable to cast COM object of type 'System.__ComObject' ...
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Shell.Interop.IVsDesignTimeAssemblyResolution'.
Read more >Unable to cast COM object of type 'System ComObject'
In this video I will show you how to solve the following error: Unable to cast COM object of type ' System. __ComObject...
Read more >Unable to cast object of type 'Wisej.Web.Form ...
This problem occurs with all systems (winforms, wpf, asp.net) and all frameworks. Try to delete /bin and /obj, and .vs after closing the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
According to the Windows SDK, ITfThreadMgr2 does not implement ITfThreadMgr (They do not share the same vtbl). It seems that even though ITfThreadMgr2 does not implement ITfThreadMgr, you can call QueryInterface with ITfThreadMgr2 on a ITfThreadMgr pointer. So if the pointer returned by TF_CreateThreadMgr is ITfThreadMgr2 it could cause this type of exception. I don’t know if this is the case here because it would be very weird since TF_CreateThreadMgr returns ITfThreadMgr according to the SDK. I’m not setup to try it since it looks like it requires specific input but if anyone can try to cast everything to ITfThreadMgr2 before using the instance of the COM object it would be great.
Yes. Alternatively, you can reproduce this issue by making multiple calls to CoInitialize in the code.