[Mono-bugs] [Bug 649994] New: PrinterSettings.InstalledPrinters throws an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 28 15:29:19 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=649994

https://bugzilla.novell.com/show_bug.cgi?id=649994#c0


           Summary: PrinterSettings.InstalledPrinters throws an exception
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 1.2.0
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dpldobrev at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=397641)
 --> (http://bugzilla.novell.com/attachment.cgi?id=397641)
A project reproducing the issue.

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; bg;
rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12

Trying to use PrinterSettings.InstalledPrinters generates an error: "libcups
not found. To have printing support, you need cups installed" on Mac OS X
Leopard. This is incorrect because libcups (/usr/lib/libcups.dylib) is present;
it is instlled by default because Mac OS X uses it itself for its native
printing.

Reproducible: Always

Steps to Reproduce:
1. Call PrinterSettings.InstalledPrinters in Mac OS X Leopard.
Actual Results:  
An exception that the unmanaged library of libcups cannot be found.

Expected Results:  
Obtain a list of the names of all installed printers (or an empty list if there
are none).

I made an experiment which you can find in the attached project. I copied the
class of PrintingServicesUnix, which PrinterSettings uses internally, from the
mono code base, along with its depencencies. After commenting out the usage of
some internal members (to be able to compile) I tried to access
PrintingServicesUnix.InstalledPrinters. The result was the same, libcups not
found. Then I replaced all occurences of DllImport("libcups") with
DllImport("libcups.dylib"). Recompiled, ran it again - this time it worked
right away and correcty got the name of my (virtual) printer. This is quite
strange, I thought the Mono runtime was able to find the libraries on its own
if they are specified with no extension as they are in this case?

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list