problem in execuring VS Studio command from c# code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crishna
    New Member
    • Oct 2008
    • 2

    problem in execuring VS Studio command from c# code

    I am trying to create a C# program that would execute the command

    C:\schema>xsd.e xe filename.xml

    this is the code I am using

    Code:
    string placeDir=@"C:\schema\";
    foreach (string foundName in System.IO.Directory.GetFiles(@"C:\schema\"))
    {
        System.Diagnostics.Process p = new System.Diagnostics.Process();
        System.Diagnostics.Process.Start(@"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\xsd.exe", @"""+foundName+""");
        p.Close();
    }
    I am getting an issues saying File not found. When I go to the location xds.exe I dont see anything in that folder, is that there needs to be an xsd.exe in the folder C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\


    any help
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Have you set a breakpoint to see what your "foundname" variable is set to?
    Is XSD.exe located in that directory for you?

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      Please enclose your posted code in [code] tags (See How to Ask a Question).

      This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

      Please use [code] tags in future.

      MODERATOR

      Comment

      • crishna
        New Member
        • Oct 2008
        • 2

        #4
        Originally posted by Plater
        Have you set a breakpoint to see what your "foundname" variable is set to?
        Is XSD.exe located in that directory for you?
        Yes the found name gives the name properly.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          So then which file is not found?
          What is the actual error message you are getting?
          Is it an exception thrown in your program, or is it the output from your Process starting?

          Comment

          Working...