Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1084691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:35:41+00:00 2026-05-16T22:35:41+00:00

I am trying to call MSTest.exe from a simple console app that is executed

  • 0

I am trying to call MSTest.exe from a simple console app that is executed from inside an SVN pre-commit hook.

If I use TortoiseSVN to Commit, it auto-runs the console app code below.

(skip after the code to see what happens…)

// CODE

static void Main(string[] args)
{
    string testPath = @"C:\Users\myname\Documents\SVN\Test\bin\Debug\TestProject1.dll";

    string mstest = GetMSTestOutput(testPath);

    if (mstest != null)
    {
        Console.Error.WriteLine(mstest);
        Environment.Exit(1);  // I WANT it to stop here, so I can see output while testing
    }
}

private static string GetMSTestOutput(string testPath)
{
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
    FileName = @"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe",
    UseShellExecute = false,
    CreateNoWindow = true,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    Arguments = String.Format("/testcontainer:{0}", testPath)
};

Process process = Process.Start(processStartInfo);
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
 return output;
}

// OUTPUT

This is what I see in the TortoiseSVN window:

Error: Commit failed (details follow):
Error: Commit blocked by pre-commit hook (exit code 1) with output:
Error: Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Error: Copyright (c) Microsoft Corporation. All rights reserved.
Error:
Error: File
Error: “C:\Users\myname\Documents\SVN\Test\bin\Debug\TestProject1.dll”
Error: not found .

So you can see I am calling MSTest correctly, but it’s claiming the path is wrong.

BUT, if I open a VS Command Prompt manually and type the EXACT same path, the code runs without error.

What am I doing wrong?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:35:42+00:00Added an answer on May 16, 2026 at 10:35 pm

    It’s possible, this may actually be a permissions issue, not a FnF issue.

    Run filemon while you are executing the code, and see what is actually being requested at the OS level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to call a SAP SOAP Web Service from a generated sudzc app shows
Im trying to call a method that will add or subtract 1 from a
I'm trying to call a method from another class with a simple button in
I am trying to call a inherited method that must access private attributes from
I am trying to call the GetConsoleScreenBufferInfoEx function from a console application. If it
I´m trying to call asp page from html link but with paremeters. Is that
I'm trying to call a function present in one class from another class by
I am trying to call c# function from javascript the code i have tried
I'm trying to call a movieclip called mcMain that's already on the stage. I'm
I am trying to save some values from my app using NSCoding. I'm able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.