当我尝试运行Excel AddIn时发生FileNotFoundException

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using Excel = Microsoft.Office.Interop.Excel; using Office = Microsoft.Office.Core; using Microsoft.Office.Tools.Excel; namespace ExcelAddIn1 { public partial class ThisAddIn { private UserControl1 userControl; private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane; private void ThisAddIn_Startup(object sender, System.EventArgs e) { userControl = new UserControl1(); //myCustomTaskPane = this.CustomTaskPanes.Add(myAddIn, "My Task Pane"); myCustomTaskPane = this.CustomTaskPanes.Add(userControl, "Enter Text"); myCustomTaskPane.Visible = true; } private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { } #region VSTO generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InternalStartup() { this.Startup += new System.EventHandler(ThisAddIn_Startup); this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); } #endregion } } 

我创build了一个Excel AddIn,它使用带2个button的用户控件添加文本并将图像添加到Excel工作表中。 我已经编译了没有错误的代码,但运行时抛出以下exception

找不到指定的文件(从HRESULTexception:0x80070002)