diff --git a/IOB-WIN-FORM/Iob/Generic.Protected.cs b/IOB-WIN-FORM/Iob/Generic.Protected.cs index 960f3e7d..f60275e1 100644 --- a/IOB-WIN-FORM/Iob/Generic.Protected.cs +++ b/IOB-WIN-FORM/Iob/Generic.Protected.cs @@ -4299,7 +4299,7 @@ namespace IOB_WIN_FORM.Iob /// /// /// - protected async Task trySetupPODL(int idxPODL) + protected async Task TrySetupPODLAsync(int idxPODL) { bool fatto = false; string fullUrl = $"{urlOdlStartFromPOdl}{idxPODL}"; @@ -4323,7 +4323,7 @@ namespace IOB_WIN_FORM.Iob /// /// /// - protected async Task trySetupPODL(int idxPODL, bool doConfirm, DateTime dtEve, DateTime dtCurr) + protected async Task TrySetupPODLAsync(int idxPODL, bool doConfirm, DateTime dtEve, DateTime dtCurr) { bool fatto = false; //string format = "yyyyMMddHHmmssfff"; diff --git a/IOB-WIN-SIEMENS/App.config b/IOB-WIN-SIEMENS/App.config index 37807fae..8a378bcf 100644 --- a/IOB-WIN-SIEMENS/App.config +++ b/IOB-WIN-SIEMENS/App.config @@ -5,7 +5,7 @@
- + @@ -116,15 +116,15 @@ - + - + - + @@ -132,15 +132,15 @@ - + - + - + @@ -152,7 +152,7 @@ - + @@ -168,7 +168,7 @@ - + @@ -184,4 +184,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj b/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj index 6ba35ffa..a6c8041e 100644 --- a/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj +++ b/IOB-WIN-SIEMENS/IOB-WIN-SIEMENS.csproj @@ -8,12 +8,13 @@ WinExe IOB_WIN_SIEMENS IOB-WIN-SIEMENS - v4.6.2 + v4.7.2 512 true true + x86 @@ -47,8 +48,8 @@ ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -60,17 +61,17 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll ..\packages\S7netplus.0.1.9\lib\net45\S7.Net.dll - ..\packages\StackExchange.Redis.2.8.58\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.10.1\lib\net472\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -79,18 +80,22 @@ ..\packages\System.Diagnostics.PerformanceCounter.9.0.0\lib\net462\System.Diagnostics.PerformanceCounter.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + + ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll + + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll @@ -98,8 +103,8 @@ ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -157,6 +162,7 @@ True Resources.resx + True App.config @@ -311,11 +317,4 @@ - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/IOB-WIN-SIEMENS/Properties/Resources.Designer.cs b/IOB-WIN-SIEMENS/Properties/Resources.Designer.cs index d12a58c2..d8845b87 100644 --- a/IOB-WIN-SIEMENS/Properties/Resources.Designer.cs +++ b/IOB-WIN-SIEMENS/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SIEMENS.Properties -{ - - +namespace IOB_WIN_SIEMENS.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_SIEMENS.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_SIEMENS.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-SIEMENS/Properties/Settings.Designer.cs b/IOB-WIN-SIEMENS/Properties/Settings.Designer.cs index ab4d89ff..ea236909 100644 --- a/IOB-WIN-SIEMENS/Properties/Settings.Designer.cs +++ b/IOB-WIN-SIEMENS/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SIEMENS.Properties -{ - - +namespace IOB_WIN_SIEMENS.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-SIEMENS/packages.config b/IOB-WIN-SIEMENS/packages.config index 50642373..cd1d0f1e 100644 --- a/IOB-WIN-SIEMENS/packages.config +++ b/IOB-WIN-SIEMENS/packages.config @@ -1,24 +1,24 @@  - + - - + - - + + - - - - + + + + + - + \ No newline at end of file diff --git a/IOB-WIN-SQL/App.config b/IOB-WIN-SQL/App.config index 44a6229a..b2c5633e 100644 --- a/IOB-WIN-SQL/App.config +++ b/IOB-WIN-SQL/App.config @@ -5,7 +5,7 @@
- + @@ -113,19 +113,19 @@ - + - + - + - + @@ -137,20 +137,24 @@ - + - + - + + + + + @@ -170,4 +174,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-SQL/IOB-WIN-SQL.csproj b/IOB-WIN-SQL/IOB-WIN-SQL.csproj index d6954e44..434962c1 100644 --- a/IOB-WIN-SQL/IOB-WIN-SQL.csproj +++ b/IOB-WIN-SQL/IOB-WIN-SQL.csproj @@ -9,12 +9,13 @@ WinExe IOB_WIN_SQL IOB-WIN-SQL - v4.6.2 + v4.7.2 512 true true + x86 @@ -60,11 +61,11 @@ ..\packages\EntityFramework.6.5.1\lib\net45\EntityFramework.SqlServer.dll - - ..\packages\MapoSDK.6.14.2505.2916\lib\MapoSDK.dll + + ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -79,11 +80,11 @@ ..\packages\NLog.5.3.4\lib\net46\NLog.dll - ..\packages\StackExchange.Redis.2.8.24\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.10.1\lib\net472\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -92,24 +93,27 @@ ..\packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll + + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll @@ -153,6 +157,7 @@ True Resources.resx + True App.config diff --git a/IOB-WIN-SQL/IobSql/SqlServLantek.cs b/IOB-WIN-SQL/IobSql/SqlServLantek.cs index 18d2da55..b5c3b8b9 100644 --- a/IOB-WIN-SQL/IobSql/SqlServLantek.cs +++ b/IOB-WIN-SQL/IobSql/SqlServLantek.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Net.NetworkInformation; +using System.Threading.Tasks; using static IOB_UT_NEXT.CustomObj; namespace IOB_WIN_SQL.IobSql @@ -107,7 +108,21 @@ namespace IOB_WIN_SQL.IobSql // per prima cosa recupero elenco PODL attivi x la macchina List listaPODL = new List(); bool okPodl = false; - var rawListPODL = callUrl(urlGetCurrPODL, false); + string rawListPODL = ""; + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + rawListPODL = await callUrl(urlGetNextPODL, false); + }) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in callUrl per {urlGetNextPODL}: {ex.Message}"); + } if (!string.IsNullOrEmpty(rawListPODL)) { try @@ -122,7 +137,7 @@ namespace IOB_WIN_SQL.IobSql } else { - lg.Error($"Errore: chiamata elenco PODL ({urlGetCurrPODL}) ha restituito valore vuoto"); + lg.Error($"Errore: chiamata elenco PODL ({urlGetNextPODL}) ha restituito valore vuoto"); } if (okPodl) { @@ -481,14 +496,27 @@ namespace IOB_WIN_SQL.IobSql { if (sLog2send.Action == "StartOrd") { - if (FullPodlUrl) + try { - // se il record è apertura PODL chiamo apertura - trySetupPODL(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + if (FullPodlUrl) + { + // se il record è apertura PODL chiamo apertura + await TrySetupPODLAsync(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + } + else + { + await TrySetupPODLAsync(0); + } + }) + .GetAwaiter() + .GetResult(); } - else + catch (Exception ex) { - trySetupPODL(0); + lgError($"Errore in tryClosePODL | {Environment.NewLine}{ex.Message}"); } } else if (sLog2send.Action == "EndOrd") @@ -497,11 +525,11 @@ namespace IOB_WIN_SQL.IobSql // PODL --> ODL if (FullPodlUrl) { - tryClosePODL(sLog2send.IdxPodl, sLog2send.DtEve, DateTime.Now); + TryClosePODL(sLog2send.IdxPodl, sLog2send.DtEve, DateTime.Now); } else { - tryClosePODL(0); + TryClosePODL(0); } } } diff --git a/IOB-WIN-SQL/IobSql/SqlServPama.cs b/IOB-WIN-SQL/IobSql/SqlServPama.cs index 2abecf35..c559bc7c 100644 --- a/IOB-WIN-SQL/IobSql/SqlServPama.cs +++ b/IOB-WIN-SQL/IobSql/SqlServPama.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Net.NetworkInformation; +using System.Threading.Tasks; using static IOB_UT_NEXT.CustomObj; namespace IOB_WIN_SQL.IobSql @@ -105,7 +106,21 @@ namespace IOB_WIN_SQL.IobSql // per prima cosa recupero elenco PODL attivi x la macchina List listaPODL = new List(); bool okPodl = false; - var rawListPODL = callUrl(urlGetNextPODL, false); + string rawListPODL = ""; + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + rawListPODL = await callUrl(urlGetNextPODL, false); + }) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in callUrl per {urlGetNextPODL}: {ex.Message}"); + } if (!string.IsNullOrEmpty(rawListPODL)) { try @@ -552,15 +567,28 @@ namespace IOB_WIN_SQL.IobSql { if (sLog2send.Action == "StartOrd") { - if (FullPodlUrl) + try { - // se il record è apertura PODL chiamo apertura - trySetupPODL(sLog2send.IdxPodl); - //trySetupPODL(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + if (FullPodlUrl) + { + // se il record è apertura PODL chiamo apertura + await TrySetupPODLAsync(sLog2send.IdxPodl); + //TrySetupPODLAsync(sLog2send.IdxPodl, true, sLog2send.DtEve, DateTime.Now); + } + else + { + await TrySetupPODLAsync(0); + } + }) + .GetAwaiter() + .GetResult(); } - else + catch (Exception ex) { - trySetupPODL(0); + lgError($"Errore in tryClosePODL | {Environment.NewLine}{ex.Message}"); } } else if (sLog2send.Action == "EndOrd") @@ -569,12 +597,12 @@ namespace IOB_WIN_SQL.IobSql // PODL --> ODL if (FullPodlUrl) { - tryClosePODL(sLog2send.IdxPodl); + TryClosePODL(sLog2send.IdxPodl); //tryClosePODL(sLog2send.IdxPodl, sLog2send.DtEve, DateTime.Now); } else { - tryClosePODL(0); + TryClosePODL(0); } } } diff --git a/IOB-WIN-SQL/Properties/Resources.Designer.cs b/IOB-WIN-SQL/Properties/Resources.Designer.cs index 6a41beb1..dec96b15 100644 --- a/IOB-WIN-SQL/Properties/Resources.Designer.cs +++ b/IOB-WIN-SQL/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SQL.Properties -{ - - +namespace IOB_WIN_SQL.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_SQL.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_SQL.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-SQL/Properties/Settings.Designer.cs b/IOB-WIN-SQL/Properties/Settings.Designer.cs index af9ad9e1..2a9163b0 100644 --- a/IOB-WIN-SQL/Properties/Settings.Designer.cs +++ b/IOB-WIN-SQL/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_SQL.Properties -{ - - +namespace IOB_WIN_SQL.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-SQL/packages.config b/IOB-WIN-SQL/packages.config index c8e1016d..361c1475 100644 --- a/IOB-WIN-SQL/packages.config +++ b/IOB-WIN-SQL/packages.config @@ -3,23 +3,24 @@ - - + + - + - - - + + + - - - - + + + + + - + \ No newline at end of file diff --git a/IOB-WIN-WS/App.config b/IOB-WIN-WS/App.config index c34e9ab5..a0812fea 100644 --- a/IOB-WIN-WS/App.config +++ b/IOB-WIN-WS/App.config @@ -5,7 +5,7 @@
- + @@ -111,11 +111,11 @@ - + - + @@ -123,7 +123,7 @@ - + @@ -131,28 +131,36 @@ - + - + - + - + - + + + + + + + + + @@ -172,4 +180,4 @@ - \ No newline at end of file + diff --git a/IOB-WIN-WS/IOB-WIN-WS.csproj b/IOB-WIN-WS/IOB-WIN-WS.csproj index e6d762c7..ad865a2d 100644 --- a/IOB-WIN-WS/IOB-WIN-WS.csproj +++ b/IOB-WIN-WS/IOB-WIN-WS.csproj @@ -9,12 +9,13 @@ WinExe IOB_WIN_WS IOB-WIN-WS - v4.6.2 + v4.7.2 512 true true + x86 @@ -60,11 +61,11 @@ ..\packages\EntityFramework.6.5.1\lib\net45\EntityFramework.SqlServer.dll - - ..\packages\MapoSDK.6.14.2505.2916\lib\MapoSDK.dll + + ..\packages\MapoSDK.6.14.2509.1018\lib\MapoSDK.dll - - ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll @@ -76,17 +77,17 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll + ..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net472\Pipelines.Sockets.Unofficial.dll - - ..\packages\RestSharp.112.1.0\lib\netstandard2.0\RestSharp.dll + + ..\packages\RestSharp.113.0.0\lib\net471\RestSharp.dll - ..\packages\StackExchange.Redis.2.8.24\lib\net461\StackExchange.Redis.dll + ..\packages\StackExchange.Redis.2.10.1\lib\net472\StackExchange.Redis.dll - - ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + + ..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll @@ -94,19 +95,25 @@ ..\packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll - - ..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll + + + ..\packages\System.IO.Hashing.9.0.10\lib\net462\System.IO.Hashing.dll - - ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + ..\packages\System.IO.Pipelines.10.0.0\lib\net462\System.IO.Pipelines.dll + + + ..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll - - ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + ..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll @@ -127,21 +134,19 @@ ..\packages\System.ServiceModel.Security.4.8.1\lib\net461\System.ServiceModel.Security.dll - - ..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.10.0.0\lib\net462\System.Text.Encodings.Web.dll - - ..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll + + ..\packages\System.Text.Json.10.0.0\lib\net462\System.Text.Json.dll ..\packages\System.Threading.Channels.9.0.0\lib\net462\System.Threading.Channels.dll - - ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + + ..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll + @@ -185,6 +190,7 @@ True Resources.resx + True App.config @@ -312,6 +318,10 @@ + + + + \ No newline at end of file diff --git a/IOB-WIN-WS/IobWs/EmmegiFPW.cs b/IOB-WIN-WS/IobWs/EmmegiFPW.cs index 1300c38c..bcc1170d 100644 --- a/IOB-WIN-WS/IobWs/EmmegiFPW.cs +++ b/IOB-WIN-WS/IobWs/EmmegiFPW.cs @@ -10,6 +10,7 @@ using System.IO; using System.Linq; using System.Net.NetworkInformation; using System.Runtime.Remoting.Contexts; +using System.Threading.Tasks; using System.Xml.Serialization; using static IOB_UT_NEXT.CustomObj; using static IOB_UT_NEXT.DataModel.UstdData; @@ -72,7 +73,20 @@ namespace IOB_WIN_WS.IobWs } // faccio un fileImport preliminare... - ProcessFileImport(); + try + { + // PONTE SYNC/ASYNC: Ora sw.Stop() aspetterà la fine reale dell'operazione + Task.Run(async () => + { + await ProcessFileImportAsync(); + }) + .GetAwaiter() + .GetResult(); + } + catch (Exception ex) + { + lgError($"Errore in ProcessFileImportAsync{Environment.NewLine}{ex.Message}"); + } if (EnableTest) { @@ -521,7 +535,7 @@ namespace IOB_WIN_WS.IobWs /// Effettua eventuale file import del file excel come array json in REDIS /// /// - protected override bool ProcessFileImport() + protected override async Task ProcessFileImportAsync() { bool answ = false; @@ -565,7 +579,7 @@ namespace IOB_WIN_WS.IobWs { // avvio proc import tramite exe tool esterno... FileProcMan fpm = new FileProcMan(exclToolDirPath, "ExcImport.exe", rKeyConf, FileConfPath); - lgInfo($"ProcessFileImport | FileConfPath: {FileConfPath} | exclToolDirPath: {exclToolDirPath} | FileInPath: {FileInPath}"); + lgInfo($"ProcessFileImportAsync | FileConfPath: {FileConfPath} | exclToolDirPath: {exclToolDirPath} | FileInPath: {FileInPath}"); fpm.doProcess(FileInPath, 0); answ = true; // aggiorno md5... @@ -578,10 +592,10 @@ namespace IOB_WIN_WS.IobWs // eseguo un SetJobDataEmmegiFPW ogni 60 sec... if (DateTime.Now.Subtract(lastSetJob).TotalSeconds > 60) { + await Task.Delay(1); SetJobDataEmmegiFPW(); lastSetJob = DateTime.Now; } - return answ; } diff --git a/IOB-WIN-WS/Properties/Resources.Designer.cs b/IOB-WIN-WS/Properties/Resources.Designer.cs index 0074390b..15e63443 100644 --- a/IOB-WIN-WS/Properties/Resources.Designer.cs +++ b/IOB-WIN-WS/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_WS.Properties -{ - - +namespace IOB_WIN_WS.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace IOB_WIN_WS.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_WIN_WS.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/IOB-WIN-WS/Properties/Settings.Designer.cs b/IOB-WIN-WS/Properties/Settings.Designer.cs index 8a1fbd2c..ff457d3f 100644 --- a/IOB-WIN-WS/Properties/Settings.Designer.cs +++ b/IOB-WIN-WS/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace IOB_WIN_WS.Properties -{ - - +namespace IOB_WIN_WS.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/IOB-WIN-WS/packages.config b/IOB-WIN-WS/packages.config index e8b8ed40..e3c424b4 100644 --- a/IOB-WIN-WS/packages.config +++ b/IOB-WIN-WS/packages.config @@ -3,23 +3,24 @@ - - + + - + - - - - + + + + - - - - + + + + + @@ -27,9 +28,9 @@ - - + + - - + + \ No newline at end of file