Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. IIS - executing an external application

IIS - executing an external application

Scheduled Pinned Locked Moved Web Development
helpcsharpasp-netwindows-admindebugging
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hssaroch
    wrote on last edited by
    #1

    Hi, I am building an ASP.NET(2) app and am using IIS(6) on W2K3. In one of my pages I need to call an external executable (pass it some arguments and get the result back). But when I run the webapp, the program doesn't execute. On debugging it says "Access not allowed". I doubt it's not ASP.Net issue rather an IIS issue but am not sure. I tried almost every thing I could find through Google but no good. Any help in this regard would be highly appericiated. Here is the code I wrote: Process proc = new Process(); string file = @"Bin\kuma.exe"; proc.StartInfo.FileName = file; proc.StartInfo.Arguments = "arg1 arg2 arg3"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardInput = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.CreateNoWindow = true; proc.Start(); /* Read proc output ... */ StreamReader output = proc.StandardOutput; string txt = output.ReadToEnd(); Trace.Write("txt" + txt); Thanks and regards.

    M 1 Reply Last reply
    0
    • H hssaroch

      Hi, I am building an ASP.NET(2) app and am using IIS(6) on W2K3. In one of my pages I need to call an external executable (pass it some arguments and get the result back). But when I run the webapp, the program doesn't execute. On debugging it says "Access not allowed". I doubt it's not ASP.Net issue rather an IIS issue but am not sure. I tried almost every thing I could find through Google but no good. Any help in this regard would be highly appericiated. Here is the code I wrote: Process proc = new Process(); string file = @"Bin\kuma.exe"; proc.StartInfo.FileName = file; proc.StartInfo.Arguments = "arg1 arg2 arg3"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardInput = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.CreateNoWindow = true; proc.Start(); /* Read proc output ... */ StreamReader output = proc.StandardOutput; string txt = output.ReadToEnd(); Trace.Write("txt" + txt); Thanks and regards.

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      You must give permission to the process that is running the website such as IUSR_ to the location of the executable. Cleako

      H 1 Reply Last reply
      0
      • M Marcus J Smith

        You must give permission to the process that is running the website such as IUSR_ to the location of the executable. Cleako

        H Offline
        H Offline
        hssaroch
        wrote on last edited by
        #3

        Hi, I have already tried this. Also I have allowed "all unkonwn cgi extensions" in web services extensions tab in IIS manager but to no avail.

        T 1 Reply Last reply
        0
        • H hssaroch

          Hi, I have already tried this. Also I have allowed "all unkonwn cgi extensions" in web services extensions tab in IIS manager but to no avail.

          T Offline
          T Offline
          TCHamilton
          wrote on last edited by
          #4

          Did you ever get this solved? I have an ASP.NET that needs to create some files on the server, then zip them up and send them to the client. Do you have any suggestions? Thank you

          Tom

          H 1 Reply Last reply
          0
          • T TCHamilton

            Did you ever get this solved? I have an ASP.NET that needs to create some files on the server, then zip them up and send them to the client. Do you have any suggestions? Thank you

            Tom

            H Offline
            H Offline
            hssaroch
            wrote on last edited by
            #5

            Yes. It was a long time ago but I think the issue was in fact regarding the execute permissions. After giving the network service account execute permission on the exe, it worked fine. I am not sure about your particular case. You can enable gzip compression in IIS or if you specifically want to send .zip archive, you can use some command line tool like rar. HTH, Aaron.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups