简体   繁体   中英

System.Drawing.Printing is not available for windows server

I am doing a Windows service using visual studio 2012

I want that service to print something

I normally can print stuff, but in this case, I got that System.Drawing.Printing is not available

could you help me please

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {}

System.Drawing.Printing.PrintPageEventArgs class live in System.Drawing.dll assembly. So you must add the reference to System.Drawing assembly in order to use it.

If you have the assembly reference in place and still you get the error? Please refer my answer here

由于某些原因,您需要引用“ ReachFramework”以使System.Printing.PrintTicket和System.Printing.PrintCapabilities

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM