项目debug跟releaes有啥区别? debug模式下程序可以通过,releaes下就报错了。问题是路径不对了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你看看报错的代码附近,是不是有#IF DEBUG这样的代码 没有这种代码。就是我要输出一个word文档的时候,说路径不对。release下就出问题了。 你查看一下Build的Output路径。 未处理 System.Runtime.InteropServices.COMException HelpLink="C:\\Program Files\\Microsoft Office\\OFFICE11\\2052\\wdmain11.chm#24632" Message="这不是有效文件名。\n请试用下列方法: \n* 检查路径,确认键入无误。\n* 从文件和文件夹列表中选择文件。" Source="Microsoft Word" ErrorCode=-2146823136 StackTrace: 在 Microsoft.Office.Interop.Word.InlineShapes.AddPicture(String FileName, Object& LinkToFile, Object& SaveWithDocument, Object& Range) 在 OfficeHelper.WordHelper.AddHeader(String text, String type) 在 OfficeHelper.WordHelper.DealNode(XmlNode node) 在 OfficeHelper.WordHelper.CreateDoc(String xmlText, String filename) 在 Yg.Business.Steps.StepsCalc.CalcStepSeries() 位置 d:\My Documents\Downloads\YgPrject\YgPrject\YgBusiness\Steps\StepsCalc.cs:行号 312 在 Yg.CAD.FormMain.toolStripButton13_Click(Object sender, EventArgs e) 位置 d:\My Documents\Downloads\YgPrject\YgPrject\程序界面\FormMain.cs:行号 816 在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) 在 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) 在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) 在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) 在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m) 在 System.Windows.Forms.ToolStrip.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.Run(Form mainForm) 在 Yg.CAD.Program.Main() 位置 D:\My Documents\Downloads\YgPrject\YgPrject\程序界面\Program.cs:行号 17 在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) 在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart()这个就是错误 文件路径的问题别用绝对路径 比方说你放在 程序启动的目录的话用:Application.StartupPath+@"\文件名称.doc"; 关于开发中的测试 关于FORM中 BUTTON按键的问题 急急急Win Form中datagridview链接数据库问题 请教各位高手如何把一段字符串原样的写到数据库的varbinary类型的字段中 关于filestream的问题 大家帮我看看下面的代码 如何正确安装 Visual Studio.Net 编译器 OutputCache中VaryByParam的值location;count 是什么意思 求一正则,非常感谢!! 在线等~ 在word里面shape如何转成图片? 请高手帮忙看一下 WCF高手请进
HelpLink="C:\\Program Files\\Microsoft Office\\OFFICE11\\2052\\wdmain11.chm#24632"
Message="这不是有效文件名。\n请试用下列方法: \n* 检查路径,确认键入无误。\n* 从文件和文件夹列表中选择文件。"
Source="Microsoft Word"
ErrorCode=-2146823136
StackTrace:
在 Microsoft.Office.Interop.Word.InlineShapes.AddPicture(String FileName, Object& LinkToFile, Object& SaveWithDocument, Object& Range)
在 OfficeHelper.WordHelper.AddHeader(String text, String type)
在 OfficeHelper.WordHelper.DealNode(XmlNode node)
在 OfficeHelper.WordHelper.CreateDoc(String xmlText, String filename)
在 Yg.Business.Steps.StepsCalc.CalcStepSeries() 位置 d:\My Documents\Downloads\YgPrject\YgPrject\YgBusiness\Steps\StepsCalc.cs:行号 312
在 Yg.CAD.FormMain.toolStripButton13_Click(Object sender, EventArgs e) 位置 d:\My Documents\Downloads\YgPrject\YgPrject\程序界面\FormMain.cs:行号 816
在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
在 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 Yg.CAD.Program.Main() 位置 D:\My Documents\Downloads\YgPrject\YgPrject\程序界面\Program.cs:行号 17
在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
这个就是错误