Class not registered

Hi,

I am using aspose.words to insert text into bookmarks in a word document and everything works great on development side, but once i deploy to an iis server, I receive Class not registered error when the aspose.word event starts.

Thanks,

Tyler

This message was posted using Aspose.Live 2 Forum

Hi

Thanks for your inquiry. Have you got any exception? Could you please provide me details of the exception? Please attach stack trace of the exception.

Best regards,

Now I do not get the exception, the page just freezes once it is published to iis. It works flawlessly in visual studio when debugging from either my local machine or if I load it in visual studio from the web server.

Also, aspose.word doesn’t show up in the .net reference list. I have to browse to the dll in C:\aspose\aspose.words for .net\bin\net2.0

That includes the dll in my asp.net project.

Hi

Thank you for additional information. I am not sure that this problem is related to Aspose.Words. Could you please remove all code related to Aspose.Words and publish your application.

Also there is no any difference from where you add reference to Aspose.Words dll.

Best regards,

It is definitely related to aspose.words, this web app has been running without it, using office automation. Commented out aspose.words part and it runs fine. Does aspose have to be installed on development pc and also and web server?

Thanks

You do no need to have Aspose.Words installed on the server. All that you need is reference to Aspose.Words dll. Could you please check Bin folder of your application, there should be Aspose.Words dll.

Best regards,

The aspose.words.dll is in the bin folder.

Thanks

Hi,

Thanks for additional information.

Could you please provide some more information.
What OS is installed on the server, What version of IIS is used. And please copy here the entire error “Class not registered” from the event log. We try to give you advice on this problem.

Sure,

Just rebuilding server in hopes that there were conflicts with other products on it.
I will try again with a fresh windows 2003 32 bit server.

Thanks,
Tyler

Hi

Ok. We will wait for your inputs.

Best regards,

Hi,
Rebuilt server and published asp.net page with same result. Just loads and loads and doesn’t print the document. No errors, just load forever. It does another process before which inserts a record in a database for each record processed which works on the first record. This happens before the aspose call so at the aspose call it is freezing.

Works fine locally run still.

Thanks,
Tyler

I think it is failing on the doc.Print() command
Where is the printer it prints to?

On the browsing users printer or the default printer on the iis hosting server?

Hi

Could you please show me the code which will help me to reproduce the problem on my side?

Best regards,

Hi
Thanks for your request. I think, the following article should be useful for you:
https://docs.aspose.com/words/net/print-a-document-programmatically-or-using-dialogs/
Best regards,

Sure,

I pass this

foreach (GridViewRow row in gvConsultants.Rows)
{
    count++;
    printAsposeLetter(row);
}

To this method

public void printAsposeLetter(GridViewRow row)
{
    //Document doc = new Document(@"C:\Documents and Settings\tyler.hess.NORWEX\My Documents\Visual Studio 2010\Projects\USChargeforKits1\Docs\Letter.doc");
    Document doc = new Document(@"C:\Inetpub\USChargeForKits\Docs\Letter.doc");
    Bookmark bookName = doc.Range.Bookmarks["bookName"];
    Bookmark bookDueDate = doc.Range.Bookmarks["bookDueDate"];
    Bookmark bookDateStarted = doc.Range.Bookmarks["bookDateStarted"];

    DateTime dueDate = Convert.ToDateTime(txtDueDate.Text);
    DateTime dateStarted = Convert.ToDateTime(row.Cells[2].Text);
    bookName.Text = Convert.ToString(((Label)row.FindControl("lblFName")).Text) + " " + Convert.ToString(((Label)row.FindControl("lblLName")).Text);
    bookDueDate.Text = dueDate.ToString("MMM dd, yyyy");
    bookDateStarted.Text = dateStarted.ToString("MMM dd, yyyy");

    doc.Print();
}

XpsPrint Api isn’t for windows server 2003

Is there a solution for server 2003?

Hi

Thanks for your additional information.

Unfortunately, I still can not reproduce the problem on my side. But I have a suspicion that the problem with the printer by default.
Could you create a test console application and run this code.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Test printing");
doc.Print();

If the document does not print, then please check the your printer, which is configured on the server by default.

Hi

Thank you for additional information. If problem occurs only upon printing, then I think it is not a problem in Aspose.Words. Probably the problem is more general.

Please make sure that you can print in server environment. You can try using the following code for testing. This code does not use Aspose.Words at all. So if it will not work, the problem is somewhere on your side.

PrintDocument doc = new PrintDocument();
doc.PrinterSettings.PrinterName = @"\\192.168.0.2\hp LaserJet 1010 Series Driver"; 
doc.PrintPage += Doc\_PrintPage;
doc.Print();

============================================================================

private void Doc\_PrintPage(object sender, PrintPageEventArgs e)
{
    e.Graphics.DrawImage(Image.FromFile(@"C:\Temp\test.jpg"), e.MarginBounds.Left, 
    e.MarginBounds.Top);
}

This code just prints an image.

Best regards.

I ended up just appending each new document and opening it when the process is completed and the user is just printing it once it is opened.

Is there an offline documentation manual that I can print complete instead of going through each part of the online documentation?

Thanks,
Tyler