0

I Have Asp.Net server, when I run it as debug on local its work fine. But when I try to run it on IIS and get it from browser it does not work

For example line : System.Diagnostics.Process.Start(@"c:\Program Files (x86)\Microsoft Office\Office12\excel.exe");

I have tried System.Diagnostics.Process.Start not work from an IIS And does not helped me

Thanks a lot

  • 2
    Are you trying to open Excel on a webserver? Is Excel installed and does the IIS user have permission to access it? Running Excel using IIS has a bad smell to it. – Widor Jul 04 '17 at 10:11
  • I would not ever recommend doing this on a webserver, it will almost guaranteed crash the w3 process at some point. What are you trying to achieve? – Thomas Schmidt Jul 04 '17 at 10:18
  • I am Tryng open Excel on a webserver , yes the user have permission. i read about .NET Remoting. But i did Not get how to use it –  Jul 04 '17 at 10:39
  • I am looking for easyer away –  Jul 04 '17 at 10:45
  • 1
    If you need to open the excel file and manipulate it, read data from it or similar I would for sure recommend a pure .net native solution like EPPlus or ClosedXml. This way you don't need to install anything on the server and you know it not be crashing the server unless you make some serious code mistakes. – Thomas Schmidt Jul 04 '17 at 13:28

1 Answers1

1

@Thomas is right. you shouldn't try to launch another process from an unmonitored process like w3wp.exe. This is against best practices.

There are code samples available online which provide ways to read/write excel files.

Kaushal Kumar Panday
  • 2,329
  • 13
  • 22