Simple Printing Problem?

B

Brian

Hi all,

I have an asp.net 2 application that get an image from SQL reporting
services and sends it to the printer. It works fine as a console application
on all computers and as an asp.net application on my windows xp computer.
However when I run it under IIS on a 2003 server it return the error
message:

"Settings to access printer '\\server\printer' are not valid."

I assume this is a security issue related to printing under IIS but am
unsure where to look. The application is configured with impersonation and
windows authentication etc.

Where can I look? What stops a IIS process from accessing network printers
under a windows account? How come it works on Windows XP but not Windows
2003?

Stack trace below but basically it calls PrintDocument.Print.

Thanks,
Brian
 
B

Brian

The stack trace is below. Why does it think that the thread is running under
network service when I checked and it is running under the impersonated user
account? Did the Thread.CurrentPrincipal change somehow?
Brian

Request information:

Request path: /batchprint/Execute.aspx

User host address: 192.168.1.40

User: domain\user

Is authenticated: True

Authentication Type: Negotiate

Thread account name: NT AUTHORITY\NETWORK SERVICE


Thread information:

Thread ID: 8

Thread account name: NT AUTHORITY\NETWORK SERVICE

Is impersonating: False

Stack trace: at
System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal()

at System.Drawing.Printing.PrinterSettings.GetHdevmode(PageSettings
pageSettings)

at System.Drawing.Printing.PrintController.OnStartPrint(PrintDocument
document, PrintEventArgs e)

at
System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument
document, PrintEventArgs e)

at System.Drawing.Printing.PrintController.Print(PrintDocument document)

at System.Drawing.Printing.PrintDocument.Print()

at BatchPrintUtility.PrintReport.Print()

at BatchPrintUtility.PrintReport.RenderPrint(String Report, String
Parameters, Int32 Copies)

at Execute.PrintReportBatch(Object printer)

at Execute.Page_Load(Object sender, EventArgs e)
 
B

Brian

Update on the problem:

The asp.net application seems to work fine on any computer when accessed
through http://localhost but when accessed through http://computername the
"PrintDocument.Print" returns the error message.
"Settings to access printer '\\server\printer' are not valid"

What is the difference in security (assuming this is the problem) running
localhost as compared with accessing it through the server?

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top