After some more searching I found a work around. DeCap runs via the command prompt. So I open command prompt with C# and then run the command for DeCap.
Preview below:
//Process Info
var cmdInfo = new ProcessStartInfo
{
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
FileName = "cmd.exe",
};
//Process
var cmd = new Process();
cmd.StartInfo = cmdInfo;
cmd.Start();
var outStream = cmd.StandardOutput;
var inStream = cmd.StandardInput;
//Command Line for DeCap
inStream.WriteLine("cd C:\\Program Files\\Autodesk\\Autodesk Recap");
var run = true;
var cmdTask = Task.Run(() =>
{
while (run)
{
try
{
Console.WriteLine(outstream.ReadLine());
}
catch { }
Thread.Sleep(20);
if (outStream.ReadLine().Contains("[R]"))
{
_logger.LogInformation(@"File Converted: {0}\{1}", _LAZProcessed, LAZFile.Name);
run = false;
}
}
}
});
inStream.WriteLine("{0}decap.exe{0} --importWithLicense {0}{1}{0} {0}{2}{0} {0}{3}{0}", '"', _LAZProcessed, LAZFile.Name, LAZFile.FullName);
while (!cmdTask.IsCompleted)
Thread.Sleep(1000);