i've built application print documents.
when running application using visual studio - debugging mode receive list of available printers using :
printersettings.installedprinters
and , select 1 of them print document using :
printdocument printdocument = new printdocument(); printdocument.printersettings.printername = "fax" ; //or other listed printer returned method above printdocument.printpage += printdocument_printpage; printdocument.print(); void printdocument_printpage(object sender, printpageeventargs e) { e.graphics.drawrectangle(new pen(color.red,10),new rectangle(0,0,100,100)); }
this works inside of visual studio, when migrate iis 7 root folder on same computer, gives error "there's no printers installed"
note: still can same list of available printers when deploy application root folder, when print() method called, web application throws error.
i using namespace system.drawing.printing
update : did check system.printing namespace reference page, shows box says :
"classes within system.printing namespace not supported use within windows service or asp.net application or service."
i had same issue, see in service how rpc (in services) running (network service | local sytem) , put in application pool on iis adance setting identity.
i hope help!.