Index: Application/Application.Ringtoets/App.xaml.cs =================================================================== diff -u -r74cd6b0f11758d33e1cb86f971dbc0ab59d89221 -rf2497d09cbac743fec0fefea14188519daeaed4d --- Application/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision 74cd6b0f11758d33e1cb86f971dbc0ab59d89221) +++ Application/Application.Ringtoets/App.xaml.cs (.../App.xaml.cs) (revision f2497d09cbac743fec0fefea14188519daeaed4d) @@ -336,21 +336,17 @@ private static void ParseArguments(IEnumerable arguments) { var argumentWaitForProcessRegex = new Regex("^" + argumentWaitForProcess + @"(?\d+)$", RegexOptions.IgnoreCase); - var waitForProcess = - arguments.Select(arg => new - { - arg, matches = argumentWaitForProcessRegex.Match(arg) - }).Select(@t => new - { - @t.matches.Groups["processId"].Value - }); - if (waitForProcess.Any()) + foreach (var arg in arguments) { - // Get id of previous process - var pid = int.Parse(waitForProcess.First().Value); - if (pid > 0) + var match = argumentWaitForProcessRegex.Match(arg); + if (match.Success) { - waitForProcessId = pid; + var pid = int.Parse(match.Groups["processId"].Value); + if (pid > 0) + { + waitForProcessId = pid; + break; + } } } }