diff --git a/GPW.CORE.Comp/IpUtils.cs b/GPW.CORE.Comp/IpUtils.cs index 19ed680..e714913 100644 --- a/GPW.CORE.Comp/IpUtils.cs +++ b/GPW.CORE.Comp/IpUtils.cs @@ -19,22 +19,27 @@ namespace GPW.CORE.Comp { string devIp = firstIp; IPAddress clientIP = IPAddress.Parse(devIp); - IPHostEntry GetIPHost = Dns.GetHostEntry(clientIP); - if (GetIPHost != null) + try { - // se trovo + di 1 ip cerco il primo NON IPV6... - if (GetIPHost.AddressList.Count() > 1) + IPHostEntry GetIPHost = Dns.GetHostEntry(clientIP); + if (GetIPHost != null) { - foreach (IPAddress item in GetIPHost.AddressList) + // se trovo + di 1 ip cerco il primo NON IPV6... + if (GetIPHost.AddressList.Count() > 1) { - if (item.AddressFamily == AddressFamily.InterNetwork) + foreach (IPAddress item in GetIPHost.AddressList) { - devIp = item.ToString(); - break; + if (item.AddressFamily == AddressFamily.InterNetwork) + { + devIp = item.ToString(); + break; + } } } } } + catch + { } return devIp; } } diff --git a/GPW.CORE.SMART/GPW.CORE.SMART.csproj b/GPW.CORE.SMART/GPW.CORE.SMART.csproj index 3ba7b78..35eb1d1 100644 --- a/GPW.CORE.SMART/GPW.CORE.SMART.csproj +++ b/GPW.CORE.SMART/GPW.CORE.SMART.csproj @@ -30,6 +30,9 @@ + + Always + TextTemplatingFileGenerator post-build.cs diff --git a/GPW.CORE.SMART/logs/.placeholder b/GPW.CORE.SMART/logs/.placeholder new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/GPW.CORE.SMART/logs/.placeholder @@ -0,0 +1 @@ + \ No newline at end of file