Forum Bugs

.Net C# Upgrading from 7 to 10

smiller-ninja
We have been using Prince for our print engine for years. We have just licensed the latest version and are trying to upgrade our print engine to use it. This is the method we are using: Performance improving advice/tips?

After upgrading the Prince resources, I kept getting the error: "The pipe has been ended." While trying to troubleshoot the issue, I boiled down my example to this simple method:

public MyStream Render(string princeEnginePath)
{
    Prince prince = new Prince(princeEnginePath);
    Stream outMemStream = new MemoryStream(100000);
    string html = "<html><head><title>Document Title</title></head><body><p>some content</p></body></html>";

    bool result = false;
    try
    {
        result = prince.ConvertString(html, outMemStream);
    }
    catch (Exception)
    {
        //handle exception
    }

    if (!result)
    {
        throw new Exception("Error");
    }

    outMemStream.Seek(0, SeekOrigin.Begin);
    return new MyStream("application/pdf", outMemStream);
}


I no longer get the exception, but the value of "result" always returns false. Can someone tell what's changed that would be causing these issues?

Thanks,
S. Miller
mikeday
It would help to call SetLog() and specify a log file to collect errors and warnings. Also, it may help to get the latest version of the wrapper library if you have upgraded Prince.
smiller-ninja
Thanks, Mike.

I tried what you suggested. I have the latest wrapper and the latest prince-10r4p1-win64.zip and the latest prince-dotnet-r11.zip. I also tried SetLog() and nothing was written to the log file.
mikeday
Can you successfully run Prince from the command-line? It sounds like it might not even be executing.
smiller-ninja
No, I can not. Using prince-10r4p1-win64\bin\prince.exe I tried running the following from the command line:
prince.exe test.xml


I get this error:
Mercury runtime: cannot set SIGSEGV handler: No error


The XML is trivial (attached), but even if I try this:
prince.exe --version


I get the same error
Mercury runtime: cannot set SIGSEGV handler: No error


Using Windows 8.1 Enterprise; Intel(R) Core(TM) i7-4600U x64-based processor
  1. test.xml0.2 kB
    Test XML file

Edited by smiller-ninja

mikeday
Okay, there's the problem! We'll take a look at this. :)
vstas
Same problem here, can't even execute in command line. Also Windows 8.1 Enterprise. Tried running from administrator command prompt, didn't help. Seems to run fine on Win 7 and Server 2012
mikeday
We've isolated the problem and will be making a new maintenance release shortly, sorry for the inconvenience.
vstas
Great! Any idea as far as the ETA yet? Thanks!
mikeday
It should be just a few days at most, we're just making sure everything is working.
vstas
Perfect, thanks!
Pauline Carter
I want to run prince from within a webservice on operating system 2012R2. I am getting an error message at the command prompt as follows;

Mercury runtime: cannot set SIGSEGV handler: No error

I have an evalution copy of the dll and exe. Would this work if we purchased or is a limitation that is known about.

mikeday
This is a bug that we have now fixed and we will be releasing an updated Prince package for Windows very shortly, sorry for the inconvenience.
mikeday
New ZIP packages are now available for Windows 32-bit and 64-bit, and the installer will be updated shortly.
smiller-ninja
Thanks! We'll give it a go and let you know if it works.
smiller-ninja
This has fixed the glitch for us - Thank you :)

Edited by smiller-ninja