程式筆記、學習心得...
本站舊有網域 xyz.cinc.biz (2011-10-10 ~ 2023-10-09),2023-10-10 之後不再使用。若文章、留言有 *.cinc.biz 的連結、Email,目前已無效。
2013年8月13日 星期二
C# 輸出 Excel 出現找不到 Marshal.GetTypeFromCLSID 方法
用 C# 輸出 Excel,在自己的電腦可以正常執行,
但到其他電腦卻不行,出現以下錯誤訊息:
System.MissingMethodException: 找不到方法: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)'
(System.MissingMethodException: Method not found: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)')
後來發現是 .NET Framework 版本的問題,要 4.5 才有支援 Marshal.GetTypeFromCLSID 方法
將其他電腦安裝 .NET Framework 4.5 後就解決了。
官網說明
http://msdn.microsoft.com/zh-tw/library/system.runtime.interopservices.marshal.gettypefromclsid.aspx
Marshal.GetTypeFromCLSID 方法,支援版本:4.5
安裝 Microsoft .NET Framework 4.5
網址:http://www.microsoft.com/zh-tw/download/details.aspx?id=30653
參考
http://stackoverflow.com/questions/12655236/excel-interop-missingmethodexception
https://github.com/bcleary/outlook-gmail-rules-export/issues/3
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言