Exception type: System.InvalidCastException Message: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the C...
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6D5140C1-7436-11CE-8034-00AA006009FA}' fa...
Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' ...
System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IHostItemFactoryNoMAF'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A0885C0A-33F2...
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error:...
Unable to cast COM object of type 'System.__ComObject' to interface type 'OPC.IOPCServerList'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{13486D50-4821-11D2-A494-3CB306C10000}' failed due to the following error: Class not regi...
【手记】解决涉及office的程序报“Unable to cast COM object of type System._ComObject...”的问题 报错内容大概像这种: 如果该电脑曾经装过WPS,那解决方法就是把WPS装回来,可以不用,但别卸,把它供着,惹不起。
Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component fo...
Excel Application Scope: Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘System.Runtime.InteropServices.ComTypes.IConnectionPointContainer’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{B196B284-BAB4-...
如下图,代码执行到ToList()就会跳到异常,单点到这个地方的时候,异常信息就是unable to cast object of type "System.String" to "System.Int32",其实看到这个报错是非常明显的,就是转换类型报错,查询出的数据库类型,与在代码的中实体类的类型不能匹配上,类型转换失败导致的。