那你有没有吧,bin目录下.dll也一起发布?

解决方案 »

  1.   

    有啊,共三个。打包工具自己检测的三个依赖项interop.office.dll
    interop.word.dll,interop.vbide.dll
      

  2.   

    public C_Print()
    {

    try
    {
                    
     wordApp=new Word.ApplicationClass();
     this.LoadWord=true;

    }
    catch(Exception e)
    {
    // MessageBox.Show(e.Message +e.Source);
       MessageBox.Show("对不起,您没有安装Word,所以无法进行打印!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
       this.LoadWord=false;
       wordApp=null;
       return;
    }
    try
    {

    wordDoc=wordApp.Documents.Add(ref template,ref missing,ref DocumentType,ref isVisible);
    // wordDoc=wordApp.Documents.AddOld(ref template,ref missing);
        this.LoadWord=true;
    }
    catch
    {
    MessageBox.Show("对不起,您的软件安装不完全,模板丢失!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
    this.LoadWord=false;
    wordApp.Quit(ref missing,ref missing,ref missing);
    return;
    }

    }以上构造函数,当不好的机器使用时,就会有提示:对不起,您没有安装Word,所以无法进行打印!
      

  3.   

    错误提示是:呼叫请求别对方拒绝。
    关调用实时 (JIT) 调试而不是此对话框的详细信息,
    请参阅此消息的结尾。************** 异常文本 **************
    System.Runtime.InteropServices.COMException (0x80010001): 呼叫请求被对方拒绝。
       at TravelLibrary.C_Print..ctor()
       at TravelLibrary.F_Line.print_data(Object sender, EventArgs e)
       at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
       at System.Windows.Forms.MenuItemData.Execute()
       at System.Windows.Forms.Command.Invoke()
       at System.Windows.Forms.Control.WmCommand(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** 已加载的程序集 **************
    mscorlib
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/microsoft.net/framework/v1.0.3705/mscorlib.dll
    ----------------------------------------
    TravelLibrary
        程序集版本:1.0.1100.25311
        Win32 版本:1.0.1100.25311
        基本代码:file:///C:/PROGRAM%20FILES/ULIKA/TRAVELLIBRARY/TRAVELLIBRARY.EXE
    ----------------------------------------
    System.Windows.Forms
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
    ----------------------------------------
    System
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
    ----------------------------------------
    System.Drawing
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
    ----------------------------------------
    mscorlib.resources
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3300.0
        基本代码:file:///c:/windows/assembly/gac/mscorlib.resources/1.0.3300.0_zh-chs_b77a5c561934e089/mscorlib.resources.dll
    ----------------------------------------
    System.Data
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
    ----------------------------------------
    System.Xml
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3705.0
        基本代码:file:///c:/windows/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
    ----------------------------------------
    System.resources
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3300.0
        基本代码:file:///c:/windows/assembly/gac/system.resources/1.0.3300.0_zh-chs_b77a5c561934e089/system.resources.dll
    ----------------------------------------
    System.Windows.Forms.resources
        程序集版本:1.0.3300.0
        Win32 版本:1.0.3300.0
        基本代码:file:///c:/windows/assembly/gac/system.windows.forms.resources/1.0.3300.0_zh-chs_b77a5c561934e089/system.windows.forms.resources.dll
    ----------------------------------------
    Interop.Word
        程序集版本:8.1.0.0
        Win32 版本:8.1.0.0
        基本代码:file:///C:/PROGRAM%20FILES/ULIKA/TRAVELLIBRARY/Interop.Word.DLL
    ----------------------------------------************** JIT 调试 **************
    若要启用实时 (JIT) 调试,此
    应用程序或计算机的配置文件 (machine.config) 的 
     system.windows.forms 节中必须设置 jitDebugging 值。
    编译应用程序时还必须启用
    调试。例如:<configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>启用 JIT 调试后,任何未处理的异常
    将被发送到此计算机上注册的 JIT 调试器,
    而不是由此对话框处理。
      

  4.   

    这三个依赖项都是.net自己转化的,你还要把WORD引用的DLL一起打包进去,不过需要注意的是:这个DLL一定要设置合适,如果只设置为一般的安装在卸栽时会将DLL删除,设置为记数式安装可能就不会。还可以设置为系统DLL。
      

  5.   

    还有三个Word引用的依赖项 MSWORD9.OLB ,MSO9.DLL,VBE6EXT.OLB
    我也全部打包了。其中MSO9.DLL 的Register属性设置为vsdrfCOMRelativePath
    另两个都是Register属性都是vsdrfDoNotRegist
    现在的问题是有的机器上可以,有的却不行,难道和madc有关系吗
      

  6.   

    建议打包时候把DLL做成另外的一个合并项目。然后把输出到安装项目中。还有最好升级一下.net,打个补丁,好象老版本的在打包上上存在一些问题。
      

  7.   

    word安装良好,我用进程类可以打开