1

I tried to print from server in the IIS. It working from the Visual Studio but when publish and host from IIS, the print not working.

Below is my code:

var p = new Process();
p.StartInfo = new ProcessStartInfo()
  {
    UseShellExecute = true,
    CreateNoWindow = true,
    FileName = "D:\Document.pdf",
    WindowStyle = ProcessWindowStyle.Hidden,
    Verb = "print"
  };

p.Start();

I found other issue exactly like this , here the link and follow all the recommendation but still not work. Can anyone help and give the suggestion.

saf21
  • 814
  • 1
  • 15
  • 32

1 Answers1

0

Now I know the answer. It because of IIS doesn't have an access to print. By default when hosting application in IIS, the application was in different environment compare in Visual Studio. That's why can print in visual studio but cannot in IIS. By changing the application identity to use an account got access to print, it should be can print after change. here I attach the link to know details about it.Change Application Pool

saf21
  • 814
  • 1
  • 15
  • 32