Fixes a problem that prevented to run unit tests on a pc without Step7 installed.

Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
This commit is contained in:
Michele Cattafesta
2015-02-02 22:44:05 +01:00
parent d7bea9cfda
commit 34f304179f

View File

@@ -193,13 +193,17 @@ namespace S7.Net.UnitTest
private static void ShutDownServiceS7oiehsx64()
{
ServiceController sc = new ServiceController("s7oiehsx64");
switch (sc.Status)
try
{
case ServiceControllerStatus.Running:
sc.Stop();
break;
ServiceController sc = new ServiceController("s7oiehsx64");
switch (sc.Status)
{
case ServiceControllerStatus.Running:
sc.Stop();
break;
}
}
catch { } // service not found
}
#endregion