We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Windows 2003 Server: Automation error; The system cannot find the file specified

Hello,

I have a C# COM wrapper to Aspose.Words named FigAspose.Words. It has always worked fine and deployment and use on our development machines (WinXP) so far has been simple ie.

1. Install .NET 2.0 runtime (dotnetfx.exe)
2. Install Aspose.Words msi (Everyone)
3. Install Aspose.Pdf.msi (Everyone)
4. Copy FigAspose.dll to C:\Program Files\Aspose\Aspose.Words\Bin\net2.0

Now I come to deploy on Windows 2003 Server. Everything seems to install fine but when we try to instantiate FigAspose.Words in VBA (simple test script) we get the following “Automation error; The system cannot find the file specified”. Now I am certain this is actually referring to the Aspose.Words assembly as prior to my RegAsm of FigAspose we would receive the old “ActiveX cannot create object” message.

The problem seems to be that FigAspose cannot instantiate Aspose.Words. Is there some magic one must perform with 2003 server?

Please help.

Furthermore, attempting to simply use Aspose.Words in a C# WinForms app fails.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aspose.Words;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
try
{
Document d = new Document();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}


Yields …




See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text
System.IO.FileNotFoundException: Could not load file or assembly ‘Aspose.Words, Version=5.2.2.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Aspose.Words, Version=5.2.2.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Loaded Assemblies
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsFormsApplication1
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/share/WindowsFormsApplication1.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:


<system.windows.forms jitDebugging=“true” />


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Just tried the lastest version of Aspose.Words v8 I think. Same problem. Assembly is NOT available available after installation. After googling for hours, reverted back to Aspose.Words 5.2.2.0 and Aspose.Pdf 3.9.0.0, forced both into assembly cache with gacutil. This worked!

Now, I am not a .NET person (and now I know why; this whole assembly register this register that, gacutil this, cross your fingers … is rubbish). Despite this, I would at least like to know if using this gacutil thingy is the correct (perhaps only) method for installation on 2003 server.

Yes I was Admin when I installed the MSIs. Yes I chose “Everyone”.

I feel there must be a problem with the MSI installers when used on 2003 Server.

Aside from my obvious frustration with this particular installation the Aspose product itself is great.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Please see the following link to learn how to utilize Aspose.Words for .NET via COM:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/use-aspose-words-for-net-via-com-interop.html

Hope this helps.

Best regards.

You will see from my posts that it is not Aspose.Words nor Aspose.Pdf that we are using via COM. We have a COM wrapper that registered perfectly fine. It was Aspose.Words and Aspose.Pdf that did not install correctly until I used gacutil. In future, I suggest you read the posts before supplying an automated response.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I tested this many times before and tested once again with the latest version of Aspsoe.Words. I followed the instructions provided in this article:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/use-aspose-words-for-net-via-com-interop.html

I tested on WinXP and Win2003 and all works fine on my side. Here is code I used for testing:

'Create a ComeHelper

Dim helper

Set helper = CreateObject("Aspose.Words.ComHelper")

'Open document

Dim doc

Set doc = helper.Open("C:\Temp\in.doc")

doc.SaveToPdf("C:\Temp\out.pdf")

PS: Try using regasm util to register assemblies as described in the article.

Best regards.