How can I run this line from within a C# console app?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ronald S. Cook

    #1

    How can I run this line from within a C# console app?

    I have the following line that I wish to execute from within a C# Console
    Application.

    svcutil.exe http://localhost/COWFeedyardService/Services/Animal.svc
    /out:Animal.vb /config:App.conf ig

    Manually, I can open the Windows SDK Command Prompt and type exactly the
    above and it works. But how can I make it work from within a console app?

    Thanks for any help,
    Ron






  • ClayB

    #2
    Re: How can I run this line from within a C# console app?

    Try code like:

    Process proc = new Process();

    proc.StartInfo. FileName = @"svcutil.ex e";
    proc.StartInfo. Arguments = @"http://localhost/COWFeedyardServ ice/
    Services/Animal.svc/out:Animal.vb /config:App.conf ig";
    proc.Start();

    =============== ======
    Clay Burch
    Syncfusion, Inc.

    Comment

    • Nicholas Paldino [.NET/C# MVP]

      #3
      Re: How can I run this line from within a C# console app?

      That won't work as it is more than likely that the directory where
      svcutil is not in the PATH environment variable.

      Instead, the OP needs to specify the full path to svcutil.exe in the
      arguments to the Process class. That's really the only thing that is
      missing (which was pointed out in another thread to the OP as well, by
      myself, and others).

      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m

      "ClayB" <clayb@syncfusi on.comwrote in message
      news:1176298727 .371061.196840@ n76g2000hsh.goo glegroups.com.. .
      Try code like:
      >
      Process proc = new Process();
      >
      proc.StartInfo. FileName = @"svcutil.ex e";
      proc.StartInfo. Arguments = @"http://localhost/COWFeedyardServ ice/
      Services/Animal.svc/out:Animal.vb /config:App.conf ig";
      proc.Start();
      >
      =============== ======
      Clay Burch
      Syncfusion, Inc.
      >

      Comment

      • Ronald S. Cook

        #4
        Re: How can I run this line from within a C# console app?

        Thanks Nicholas. I was just having some trouble with the syntax after all.

        Ron

        "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c omwrote in
        message news:ONPOFQEfHH A.5044@TK2MSFTN GP05.phx.gbl...
        That won't work as it is more than likely that the directory where
        svcutil is not in the PATH environment variable.
        >
        Instead, the OP needs to specify the full path to svcutil.exe in the
        arguments to the Process class. That's really the only thing that is
        missing (which was pointed out in another thread to the OP as well, by
        myself, and others).
        >
        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m
        >
        "ClayB" <clayb@syncfusi on.comwrote in message
        news:1176298727 .371061.196840@ n76g2000hsh.goo glegroups.com.. .
        >Try code like:
        >>
        >Process proc = new Process();
        >>
        > proc.StartInfo. FileName = @"svcutil.ex e";
        > proc.StartInfo. Arguments = @"http://localhost/COWFeedyardServ ice/
        >Services/Animal.svc/out:Animal.vb /config:App.conf ig";
        >proc.Start() ;
        >>
        >============== =======
        >Clay Burch
        >Syncfusion, Inc.
        >>
        >
        >

        Comment

        Working...