79633493

Date: 2025-05-22 10:01:57
Score: 0.5
Natty:
Report link

The problem in my code is that I was running the task twice.

//Process.Start will start the process.
var process = Process.Start(new ProcessStartInfo
    {
        FileName = "dotnet",
        Arguments = $"clean \"{csprojPath}\" -c Release",
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        UseShellExecute = false,
    });
    
//2nd time here.
    process.Start();

This was causing the file access error. commenting the process.Start fixes the problem.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Zubair Khakwani