From 0e2510c8d86a599928b9a347ae19a9b1fe9b97c3 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 10:57:24 +0200 Subject: [PATCH 1/9] chore: update Nuget packages and static code analyzers --- .gitignore | 1 + Directory.Build.props | 4 ++-- .../OpcPublisherNodeManagerModule.csproj | 2 +- .../modules/simulationmodule/SimulationModule.csproj | 4 ++-- src/Atc.Azure.IoT.CLI/Atc.Azure.IoT.CLI.csproj | 4 ++-- src/Atc.Azure.IoT/Atc.Azure.IoT.csproj | 2 +- .../Atc.Azure.IoTEdge.DeviceEmulator.csproj | 2 +- src/Atc.Azure.IoTEdge/Atc.Azure.IoTEdge.csproj | 2 +- test/Atc.Azure.IoT.Tests/Atc.Azure.IoT.Tests.csproj | 6 +++--- .../Atc.Azure.IotEdge.Client.Tests.csproj | 6 +++--- 10 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 17f8ff3..c54446d 100644 --- a/.gitignore +++ b/.gitignore @@ -397,3 +397,4 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml /sample/src/IoTEdgeModules/modules/opcpublishernodemanagermodule/appsettings.emulator.json +/src/Atc.Azure.IoT.Wpf.App/appsettings.development.json diff --git a/Directory.Build.props b/Directory.Build.props index dc9852c..329c758 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -41,10 +41,10 @@ - + - + \ No newline at end of file diff --git a/sample/src/IoTEdgeModules/modules/opcpublishernodemanagermodule/OpcPublisherNodeManagerModule.csproj b/sample/src/IoTEdgeModules/modules/opcpublishernodemanagermodule/OpcPublisherNodeManagerModule.csproj index df8e410..85fc7b1 100644 --- a/sample/src/IoTEdgeModules/modules/opcpublishernodemanagermodule/OpcPublisherNodeManagerModule.csproj +++ b/sample/src/IoTEdgeModules/modules/opcpublishernodemanagermodule/OpcPublisherNodeManagerModule.csproj @@ -7,7 +7,7 @@ - + diff --git a/sample/src/IoTEdgeModules/modules/simulationmodule/SimulationModule.csproj b/sample/src/IoTEdgeModules/modules/simulationmodule/SimulationModule.csproj index 158cad1..932e237 100644 --- a/sample/src/IoTEdgeModules/modules/simulationmodule/SimulationModule.csproj +++ b/sample/src/IoTEdgeModules/modules/simulationmodule/SimulationModule.csproj @@ -7,7 +7,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/src/Atc.Azure.IoT.CLI/Atc.Azure.IoT.CLI.csproj b/src/Atc.Azure.IoT.CLI/Atc.Azure.IoT.CLI.csproj index 6d035b6..a5cc696 100644 --- a/src/Atc.Azure.IoT.CLI/Atc.Azure.IoT.CLI.csproj +++ b/src/Atc.Azure.IoT.CLI/Atc.Azure.IoT.CLI.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/src/Atc.Azure.IoT/Atc.Azure.IoT.csproj b/src/Atc.Azure.IoT/Atc.Azure.IoT.csproj index 2dbdb14..b4e018f 100644 --- a/src/Atc.Azure.IoT/Atc.Azure.IoT.csproj +++ b/src/Atc.Azure.IoT/Atc.Azure.IoT.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Atc.Azure.IoTEdge.DeviceEmulator/Atc.Azure.IoTEdge.DeviceEmulator.csproj b/src/Atc.Azure.IoTEdge.DeviceEmulator/Atc.Azure.IoTEdge.DeviceEmulator.csproj index acaf8c8..a1000b0 100644 --- a/src/Atc.Azure.IoTEdge.DeviceEmulator/Atc.Azure.IoTEdge.DeviceEmulator.csproj +++ b/src/Atc.Azure.IoTEdge.DeviceEmulator/Atc.Azure.IoTEdge.DeviceEmulator.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Atc.Azure.IoTEdge/Atc.Azure.IoTEdge.csproj b/src/Atc.Azure.IoTEdge/Atc.Azure.IoTEdge.csproj index 25bd142..71a09ad 100644 --- a/src/Atc.Azure.IoTEdge/Atc.Azure.IoTEdge.csproj +++ b/src/Atc.Azure.IoTEdge/Atc.Azure.IoTEdge.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/Atc.Azure.IoT.Tests/Atc.Azure.IoT.Tests.csproj b/test/Atc.Azure.IoT.Tests/Atc.Azure.IoT.Tests.csproj index a765447..4d6f113 100644 --- a/test/Atc.Azure.IoT.Tests/Atc.Azure.IoT.Tests.csproj +++ b/test/Atc.Azure.IoT.Tests/Atc.Azure.IoT.Tests.csproj @@ -11,9 +11,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Atc.Azure.IotEdge.Client.Tests/Atc.Azure.IotEdge.Client.Tests.csproj b/test/Atc.Azure.IotEdge.Client.Tests/Atc.Azure.IotEdge.Client.Tests.csproj index a765447..4d6f113 100644 --- a/test/Atc.Azure.IotEdge.Client.Tests/Atc.Azure.IotEdge.Client.Tests.csproj +++ b/test/Atc.Azure.IotEdge.Client.Tests/Atc.Azure.IotEdge.Client.Tests.csproj @@ -11,9 +11,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive From e2060a574f78b1015e38fec6b5912921ff27c73b Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 11:14:02 +0200 Subject: [PATCH 2/9] feat: init Atc.Azure.IoT.Wpf.App and add to solution --- Atc.Azure.IoT.sln | 7 +++ src/Atc.Azure.IoT.Wpf.App/.editorconfig | 25 ++++++++ src/Atc.Azure.IoT.Wpf.App/App.xaml | 17 ++++++ src/Atc.Azure.IoT.Wpf.App/App.xaml.cs | 59 +++++++++++++++++++ src/Atc.Azure.IoT.Wpf.App/AssemblyInfo.cs | 1 + .../Atc.Azure.IoT.Wpf.App.csproj | 35 +++++++++++ src/Atc.Azure.IoT.Wpf.App/GlobalUsings.cs | 11 ++++ src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml | 20 +++++++ src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml.cs | 51 ++++++++++++++++ .../MainWindowViewModel.cs | 11 ++++ src/Atc.Azure.IoT.Wpf.App/appsettings.json | 10 ++++ 11 files changed, 247 insertions(+) create mode 100644 src/Atc.Azure.IoT.Wpf.App/.editorconfig create mode 100644 src/Atc.Azure.IoT.Wpf.App/App.xaml create mode 100644 src/Atc.Azure.IoT.Wpf.App/App.xaml.cs create mode 100644 src/Atc.Azure.IoT.Wpf.App/AssemblyInfo.cs create mode 100644 src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj create mode 100644 src/Atc.Azure.IoT.Wpf.App/GlobalUsings.cs create mode 100644 src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml create mode 100644 src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml.cs create mode 100644 src/Atc.Azure.IoT.Wpf.App/MainWindowViewModel.cs create mode 100644 src/Atc.Azure.IoT.Wpf.App/appsettings.json diff --git a/Atc.Azure.IoT.sln b/Atc.Azure.IoT.sln index f08204d..dd6ae1a 100644 --- a/Atc.Azure.IoT.sln +++ b/Atc.Azure.IoT.sln @@ -45,6 +45,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpcPublisherNodeManagerModu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.Iot.Certificate.Sample", "sample\src\Atc.Azure.Iot.Certificate.Sample\Atc.Azure.Iot.Certificate.Sample.csproj", "{CBD19CC8-E6BF-4BF8-8121-A4E325115143}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atc.Azure.IoT.Wpf.App", "src\Atc.Azure.IoT.Wpf.App\Atc.Azure.IoT.Wpf.App.csproj", "{91F3342D-3511-4B66-A0E0-3CC4DE184387}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -91,6 +93,10 @@ Global {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Debug|Any CPU.Build.0 = Debug|Any CPU {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Release|Any CPU.ActiveCfg = Release|Any CPU {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Release|Any CPU.Build.0 = Release|Any CPU + {91F3342D-3511-4B66-A0E0-3CC4DE184387}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91F3342D-3511-4B66-A0E0-3CC4DE184387}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91F3342D-3511-4B66-A0E0-3CC4DE184387}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91F3342D-3511-4B66-A0E0-3CC4DE184387}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -109,6 +115,7 @@ Global {B5E634E9-9CF8-469B-9312-B439E797A96D} = {17137DCD-1D96-4640-9977-4CC9EED18057} {1A393DB3-C6F8-4736-9A5A-462394D320A5} = {17137DCD-1D96-4640-9977-4CC9EED18057} {CBD19CC8-E6BF-4BF8-8121-A4E325115143} = {711F4C2D-06C4-4A34-BDF3-5FA737DB1133} + {91F3342D-3511-4B66-A0E0-3CC4DE184387} = {69C84246-AA75-43E8-94B2-66FD555B18B0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {04120463-05C5-417B-8D7A-2D7D35B71A07} diff --git a/src/Atc.Azure.IoT.Wpf.App/.editorconfig b/src/Atc.Azure.IoT.Wpf.App/.editorconfig new file mode 100644 index 0000000..a2ab9c3 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/.editorconfig @@ -0,0 +1,25 @@ +# ATC coding rules - https://github.com/atc-net/atc-coding-rules +# Version: 1.0.0 +# Updated: 27-03-2024 +# Location: wpf +# Distribution: Frameworks + +########################################## +# Code Analyzers Rules +########################################## +[*.{cs}] + +dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md +dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name. + +########################################## +# Custom - Code Analyzers Rules +########################################## + +dotnet_diagnostic.MA0049.severity = none # Type name should not match containing namespace (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0049.md) + +dotnet_diagnostic.S4487.severity = none # + +dotnet_diagnostic.CA1724.severity = none # + +dotnet_diagnostic.IDE0052.severity = none # \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/App.xaml b/src/Atc.Azure.IoT.Wpf.App/App.xaml new file mode 100644 index 0000000..43a9889 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/src/Atc.Azure.IoT.Wpf.App/App.xaml.cs b/src/Atc.Azure.IoT.Wpf.App/App.xaml.cs new file mode 100644 index 0000000..481ebcd --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/App.xaml.cs @@ -0,0 +1,59 @@ +namespace Atc.Azure.IoT.Wpf.App; + +/// +/// Interaction logic for App. +/// +public partial class App +{ + private readonly IHost host; + private IConfiguration? configuration; + + public App() + { + host = Host.CreateDefaultBuilder() + .ConfigureAppConfiguration( + configurationBuilder => + { + configuration = configurationBuilder + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile("appsettings.development.json", optional: true, reloadOnChange: true) + .AddEnvironmentVariables() + .Build(); + }) + .ConfigureServices((_, services) => + { + services.AddSingleton(); + services.AddSingleton(); + }) + .Build(); + } + + private async void ApplicationStartup( + object sender, + StartupEventArgs e) + { + await host + .StartAsync() + .ConfigureAwait(false); + + ThemeManager.Current.ChangeTheme(Current, "Dark.Taupe"); + + var mainWindow = host + .Services + .GetService()!; + + mainWindow.Show(); + } + + private async void ApplicationExit( + object sender, + ExitEventArgs e) + { + await host + .StopAsync() + .ConfigureAwait(false); + + host.Dispose(); + } +} \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/AssemblyInfo.cs b/src/Atc.Azure.IoT.Wpf.App/AssemblyInfo.cs new file mode 100644 index 0000000..cccb9d1 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj new file mode 100644 index 0000000..abd69f8 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj @@ -0,0 +1,35 @@ + + + + WinExe + net8.0-windows + true + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + diff --git a/src/Atc.Azure.IoT.Wpf.App/GlobalUsings.cs b/src/Atc.Azure.IoT.Wpf.App/GlobalUsings.cs new file mode 100644 index 0000000..77ceffe --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/GlobalUsings.cs @@ -0,0 +1,11 @@ +// Global using directives + +global using System.ComponentModel; +global using System.IO; +global using System.Windows; +global using System.Windows.Input; +global using Atc.Wpf.Mvvm; +global using ControlzEx.Theming; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml b/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml new file mode 100644 index 0000000..af16c9a --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml.cs b/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml.cs new file mode 100644 index 0000000..34bbc71 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/MainWindow.xaml.cs @@ -0,0 +1,51 @@ +namespace Atc.Azure.IoT.Wpf.App; + +/// +/// Interaction logic for MainWindow. +/// +public partial class MainWindow +{ + public MainWindow( + IMainWindowViewModelBase viewModel) + { + InitializeComponent(); + DataContext = viewModel; + + Loaded += OnLoaded; + Closing += OnClosing; + KeyDown += OnKeyDown; + KeyUp += OnKeyUp; + } + + private void OnLoaded( + object sender, + RoutedEventArgs e) + { + var vm = DataContext as IMainWindowViewModelBase; + vm!.OnLoaded(this, e); + } + + private void OnClosing( + object? sender, + CancelEventArgs e) + { + var vm = DataContext as IMainWindowViewModelBase; + vm!.OnClosing(this, e); + } + + private void OnKeyDown( + object sender, + KeyEventArgs e) + { + var vm = DataContext as IMainWindowViewModelBase; + vm!.OnKeyDown(this, e); + } + + private void OnKeyUp( + object sender, + KeyEventArgs e) + { + var vm = DataContext as IMainWindowViewModelBase; + vm!.OnKeyUp(this, e); + } +} \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/MainWindowViewModel.cs b/src/Atc.Azure.IoT.Wpf.App/MainWindowViewModel.cs new file mode 100644 index 0000000..90c5a49 --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/MainWindowViewModel.cs @@ -0,0 +1,11 @@ +namespace Atc.Azure.IoT.Wpf.App; + +public partial class MainWindowViewModel : MainWindowViewModelBase, IMainWindowViewModelBase +{ +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + public MainWindowViewModel() + { + // Dummy for XAML design view + } +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. +} \ No newline at end of file diff --git a/src/Atc.Azure.IoT.Wpf.App/appsettings.json b/src/Atc.Azure.IoT.Wpf.App/appsettings.json new file mode 100644 index 0000000..222224e --- /dev/null +++ b/src/Atc.Azure.IoT.Wpf.App/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} \ No newline at end of file From 8b9115b85bdf33b9df7751ffed925317bad3e30d Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 11:34:33 +0200 Subject: [PATCH 3/9] feat: set false on Atc.Azure.IoT.Wpf.App --- src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj index abd69f8..8e004d9 100644 --- a/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj +++ b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj @@ -4,6 +4,7 @@ WinExe net8.0-windows true + false From d7dd619a538f10b65ce3ac5e12498c8d58f524df Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 11:56:32 +0200 Subject: [PATCH 4/9] feat: add solution without Wpf projects --- Atc.Azure.IoT-WithoutWpf.sln | 116 +++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Atc.Azure.IoT-WithoutWpf.sln diff --git a/Atc.Azure.IoT-WithoutWpf.sln b/Atc.Azure.IoT-WithoutWpf.sln new file mode 100644 index 0000000..f08204d --- /dev/null +++ b/Atc.Azure.IoT-WithoutWpf.sln @@ -0,0 +1,116 @@ +๏ปฟ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{69C84246-AA75-43E8-94B2-66FD555B18B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{DAC1423F-D386-4838-AEA0-8BFFBB449ED2}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{58BC6728-197C-484C-A8EC-38BC2F0B58C4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IoT", "src\Atc.Azure.IoT\Atc.Azure.IoT.csproj", "{A6CEF902-11CB-4877-BBD2-FBE1AF27A62F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IotEdge.Client.Tests", "test\Atc.Azure.IotEdge.Client.Tests\Atc.Azure.IotEdge.Client.Tests.csproj", "{607C2690-8F7C-4348-B38D-6DE633FC37F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IoT.Tests", "test\Atc.Azure.IoT.Tests\Atc.Azure.IoT.Tests.csproj", "{CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IoT.CLI", "src\Atc.Azure.IoT.CLI\Atc.Azure.IoT.CLI.csproj", "{2326FBB5-CB4B-4153-AF13-22152C265D5F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IoTEdge", "src\Atc.Azure.IoTEdge\Atc.Azure.IoTEdge.csproj", "{04852479-8932-4AE0-8D87-AABAED0EA971}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.IoTEdge.DeviceEmulator", "src\Atc.Azure.IoTEdge.DeviceEmulator\Atc.Azure.IoTEdge.DeviceEmulator.csproj", "{23EA1D43-328D-4EC1-830E-C1797E1666A6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{E84E1AF8-ACAF-4D1A-A59D-999E873C0A71}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{711F4C2D-06C4-4A34-BDF3-5FA737DB1133}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IoTEdgeModules", "IoTEdgeModules", "{E122CEC1-82DD-43C7-952A-CBF61C0273B5}" + ProjectSection(SolutionItems) = preProject + sample\src\IoTEdgeModules\deployment.debug.template.json = sample\src\IoTEdgeModules\deployment.debug.template.json + sample\src\IoTEdgeModules\deployment.template.emulation.manifest.json = sample\src\IoTEdgeModules\deployment.template.emulation.manifest.json + sample\src\IoTEdgeModules\deployment.template.json = sample\src\IoTEdgeModules\deployment.template.json + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{17137DCD-1D96-4640-9977-4CC9EED18057}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.Iot.Sample.Modules.Contracts", "sample\src\Atc.Azure.Iot.Sample.Modules.Contracts\Atc.Azure.Iot.Sample.Modules.Contracts.csproj", "{D996F215-48C7-4489-9B26-7AE3221A394A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimulationModule", "sample\src\IoTEdgeModules\modules\simulationmodule\SimulationModule.csproj", "{B5E634E9-9CF8-469B-9312-B439E797A96D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpcPublisherNodeManagerModule", "sample\src\IoTEdgeModules\modules\opcpublishernodemanagermodule\OpcPublisherNodeManagerModule.csproj", "{1A393DB3-C6F8-4736-9A5A-462394D320A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atc.Azure.Iot.Certificate.Sample", "sample\src\Atc.Azure.Iot.Certificate.Sample\Atc.Azure.Iot.Certificate.Sample.csproj", "{CBD19CC8-E6BF-4BF8-8121-A4E325115143}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A6CEF902-11CB-4877-BBD2-FBE1AF27A62F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6CEF902-11CB-4877-BBD2-FBE1AF27A62F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6CEF902-11CB-4877-BBD2-FBE1AF27A62F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6CEF902-11CB-4877-BBD2-FBE1AF27A62F}.Release|Any CPU.Build.0 = Release|Any CPU + {607C2690-8F7C-4348-B38D-6DE633FC37F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {607C2690-8F7C-4348-B38D-6DE633FC37F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {607C2690-8F7C-4348-B38D-6DE633FC37F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {607C2690-8F7C-4348-B38D-6DE633FC37F9}.Release|Any CPU.Build.0 = Release|Any CPU + {CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42}.Release|Any CPU.Build.0 = Release|Any CPU + {2326FBB5-CB4B-4153-AF13-22152C265D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2326FBB5-CB4B-4153-AF13-22152C265D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2326FBB5-CB4B-4153-AF13-22152C265D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2326FBB5-CB4B-4153-AF13-22152C265D5F}.Release|Any CPU.Build.0 = Release|Any CPU + {04852479-8932-4AE0-8D87-AABAED0EA971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04852479-8932-4AE0-8D87-AABAED0EA971}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04852479-8932-4AE0-8D87-AABAED0EA971}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04852479-8932-4AE0-8D87-AABAED0EA971}.Release|Any CPU.Build.0 = Release|Any CPU + {23EA1D43-328D-4EC1-830E-C1797E1666A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23EA1D43-328D-4EC1-830E-C1797E1666A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23EA1D43-328D-4EC1-830E-C1797E1666A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23EA1D43-328D-4EC1-830E-C1797E1666A6}.Release|Any CPU.Build.0 = Release|Any CPU + {D996F215-48C7-4489-9B26-7AE3221A394A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D996F215-48C7-4489-9B26-7AE3221A394A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D996F215-48C7-4489-9B26-7AE3221A394A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D996F215-48C7-4489-9B26-7AE3221A394A}.Release|Any CPU.Build.0 = Release|Any CPU + {B5E634E9-9CF8-469B-9312-B439E797A96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5E634E9-9CF8-469B-9312-B439E797A96D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5E634E9-9CF8-469B-9312-B439E797A96D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5E634E9-9CF8-469B-9312-B439E797A96D}.Release|Any CPU.Build.0 = Release|Any CPU + {1A393DB3-C6F8-4736-9A5A-462394D320A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A393DB3-C6F8-4736-9A5A-462394D320A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A393DB3-C6F8-4736-9A5A-462394D320A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A393DB3-C6F8-4736-9A5A-462394D320A5}.Release|Any CPU.Build.0 = Release|Any CPU + {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBD19CC8-E6BF-4BF8-8121-A4E325115143}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A6CEF902-11CB-4877-BBD2-FBE1AF27A62F} = {69C84246-AA75-43E8-94B2-66FD555B18B0} + {607C2690-8F7C-4348-B38D-6DE633FC37F9} = {58BC6728-197C-484C-A8EC-38BC2F0B58C4} + {CB8A2B57-146C-4D3F-B02C-F6DE21C5DE42} = {58BC6728-197C-484C-A8EC-38BC2F0B58C4} + {2326FBB5-CB4B-4153-AF13-22152C265D5F} = {69C84246-AA75-43E8-94B2-66FD555B18B0} + {04852479-8932-4AE0-8D87-AABAED0EA971} = {69C84246-AA75-43E8-94B2-66FD555B18B0} + {23EA1D43-328D-4EC1-830E-C1797E1666A6} = {69C84246-AA75-43E8-94B2-66FD555B18B0} + {711F4C2D-06C4-4A34-BDF3-5FA737DB1133} = {E84E1AF8-ACAF-4D1A-A59D-999E873C0A71} + {E122CEC1-82DD-43C7-952A-CBF61C0273B5} = {711F4C2D-06C4-4A34-BDF3-5FA737DB1133} + {17137DCD-1D96-4640-9977-4CC9EED18057} = {E122CEC1-82DD-43C7-952A-CBF61C0273B5} + {D996F215-48C7-4489-9B26-7AE3221A394A} = {711F4C2D-06C4-4A34-BDF3-5FA737DB1133} + {B5E634E9-9CF8-469B-9312-B439E797A96D} = {17137DCD-1D96-4640-9977-4CC9EED18057} + {1A393DB3-C6F8-4736-9A5A-462394D320A5} = {17137DCD-1D96-4640-9977-4CC9EED18057} + {CBD19CC8-E6BF-4BF8-8121-A4E325115143} = {711F4C2D-06C4-4A34-BDF3-5FA737DB1133} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {04120463-05C5-417B-8D7A-2D7D35B71A07} + EndGlobalSection +EndGlobal From b75083c8d11bc0fe6abed277aa32336dbd903e24 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 11:56:56 +0200 Subject: [PATCH 5/9] ci: adjust github workflow actions to build with and without wpf solution --- .github/workflows/post-integration.yml | 4 ++-- .github/workflows/pre-integration.yml | 18 ++++++++++++++---- .github/workflows/release.yml | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml index d660d9e..8ce0eb0 100644 --- a/.github/workflows/post-integration.yml +++ b/.github/workflows/post-integration.yml @@ -14,7 +14,7 @@ env: jobs: merge-to-stable: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: ๐Ÿ›’ Checkout repository uses: actions/checkout@v4 @@ -48,7 +48,7 @@ jobs: run: dotnet restore - name: ๐Ÿ› ๏ธ Build - run: dotnet build -c Release --no-restore /p:UseSourceLink=true + run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true - name: ๐Ÿงช Run unit tests run: dotnet test -c Release --no-build --filter "Category!=Integration" diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index 2536549..d48fd54 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -30,8 +30,13 @@ jobs: - name: ๐Ÿ” Restore packages run: dotnet restore - - name: ๐Ÿ› ๏ธ Building library in release mode - run: dotnet build -c Release --no-restore + - name: ๐Ÿ› ๏ธ Build non-wpf solution + run: dotnet build Atc.Azure.IoT-WithoutWpf.sln -c Release --no-restore + if: runner.os != 'Windows' + + - name: ๐Ÿ› ๏ธ Build all + run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore + if: runner.os == 'Windows' dotnet-test: runs-on: ubuntu-latest @@ -51,8 +56,13 @@ jobs: - name: ๐Ÿ” Restore packages run: dotnet restore - - name: ๐Ÿ› ๏ธ Build - run: dotnet build -c Release --no-restore /p:UseSourceLink=true + - name: ๐Ÿ› ๏ธ Build non-wpf solution + run: dotnet build Atc.Azure.IoT-WithoutWpf.sln -c Release --no-restore /p:UseSourceLink=true + if: runner.os != 'Windows' + + - name: ๐Ÿ› ๏ธ Build all + run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true + if: runner.os == 'Windows' - name: ๐Ÿงช Run unit tests run: dotnet test -c Release --no-build --filter "Category!=Integration" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd1ae41..9199311 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ env: jobs: release: if: github.ref == 'refs/heads/stable' - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: ๐Ÿ›’ Checkout repository uses: actions/checkout@v4 @@ -39,7 +39,7 @@ jobs: run: dotnet restore - name: ๐Ÿ› ๏ธ Building library in release mode - run: dotnet build -c Release --no-restore /p:UseSourceLink=true + run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true - name: โฉ Merge to release-branch run: | From d16de2f9269ababb54ff006f562108de7aa08e96 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 12:00:44 +0200 Subject: [PATCH 6/9] ci: adjust workflows for new wpf project --- .github/workflows/post-integration.yml | 4 ++-- .github/workflows/pre-integration.yml | 25 +++++++++++++++---------- .github/workflows/release.yml | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml index 8ce0eb0..5d55796 100644 --- a/.github/workflows/post-integration.yml +++ b/.github/workflows/post-integration.yml @@ -42,10 +42,10 @@ jobs: distribution: 'zulu' - name: ๐Ÿงน Clean - run: dotnet clean -c Release && dotnet nuget locals all --clear + run: dotnet clean Atc.Azure.IoT.sln -c Release && dotnet nuget locals all --clear - name: ๐Ÿ” Restore packages - run: dotnet restore + run: dotnet restore Atc.Azure.IoT.sln - name: ๐Ÿ› ๏ธ Build run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index d48fd54..b178c1f 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -24,11 +24,21 @@ jobs: with: dotnet-version: '8.0.x' - - name: ๐Ÿงน Clean - run: dotnet clean -c Release && dotnet nuget locals all --clear + - name: ๐Ÿงน Clean non-wpf solution + run: dotnet clean Atc.Azure.IoT-WithoutWpf.sln -c Release && dotnet nuget locals all --clear + if: runner.os != 'Windows' - - name: ๐Ÿ” Restore packages - run: dotnet restore + - name: ๐Ÿงน Clean all + run: dotnet clean Atc.Azure.IoT.sln -c Release && dotnet nuget locals all --clear + if: runner.os == 'Windows' + + - name: ๐Ÿ” Restore packages non-wpf solution + run: dotnet restore Atc.Azure.IoT-WithoutWpf.sln + if: runner.os != 'Windows' + + - name: ๐Ÿ” Restore packages all + run: dotnet restore Atc.Azure.IoT.sln + if: runner.os == 'Windows' - name: ๐Ÿ› ๏ธ Build non-wpf solution run: dotnet build Atc.Azure.IoT-WithoutWpf.sln -c Release --no-restore @@ -54,15 +64,10 @@ jobs: dotnet-version: '8.0.x' - name: ๐Ÿ” Restore packages - run: dotnet restore - - - name: ๐Ÿ› ๏ธ Build non-wpf solution - run: dotnet build Atc.Azure.IoT-WithoutWpf.sln -c Release --no-restore /p:UseSourceLink=true - if: runner.os != 'Windows' + run: dotnet restore Atc.Azure.IoT.sln - name: ๐Ÿ› ๏ธ Build all run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true - if: runner.os == 'Windows' - name: ๐Ÿงช Run unit tests run: dotnet test -c Release --no-build --filter "Category!=Integration" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9199311..5238c17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,10 +33,10 @@ jobs: dotnet-version: '8.0.x' - name: ๐Ÿงน Clean - run: dotnet clean -c Release && dotnet nuget locals all --clear + run: dotnet clean Atc.Azure.IoT.sln -c Release && dotnet nuget locals all --clear - name: ๐Ÿ” Restore packages - run: dotnet restore + run: dotnet restore Atc.Azure.IoT.sln - name: ๐Ÿ› ๏ธ Building library in release mode run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true From 3f0bec1c895d34b82a12c842dcee42b82b889e29 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 12:10:11 +0200 Subject: [PATCH 7/9] fix: remove appsettings.development.json --- src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj index 8e004d9..aa36bf9 100644 --- a/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj +++ b/src/Atc.Azure.IoT.Wpf.App/Atc.Azure.IoT.Wpf.App.csproj @@ -8,14 +8,10 @@ - - - PreserveNewest - PreserveNewest From 5f93fdd24cec6ddaf3080c2e72e3575beef19a13 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 12:15:57 +0200 Subject: [PATCH 8/9] ci: set proper runs-on for dotnet-test in pre-integration.yml workflow --- .github/workflows/pre-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index b178c1f..4036865 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -49,7 +49,7 @@ jobs: if: runner.os == 'Windows' dotnet-test: - runs-on: ubuntu-latest + runs-on: windows-latest needs: - dotnet-build steps: From cd7c48c13d51417cd80db8713fd96726f046aa37 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 May 2024 12:23:41 +0200 Subject: [PATCH 9/9] ci: ensuring dotnet test workflow steps have correct solution parameter --- .github/workflows/post-integration.yml | 2 +- .github/workflows/pre-integration.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml index 5d55796..bbd859c 100644 --- a/.github/workflows/post-integration.yml +++ b/.github/workflows/post-integration.yml @@ -51,7 +51,7 @@ jobs: run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true - name: ๐Ÿงช Run unit tests - run: dotnet test -c Release --no-build --filter "Category!=Integration" + run: dotnet test Atc.Azure.IoT.sln -c Release --no-build --filter "Category!=Integration" - name: ๐ŸŒฉ๏ธ SonarCloud install scanner run: dotnet tool install --global dotnet-sonarscanner diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/pre-integration.yml index 4036865..83e74e9 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/pre-integration.yml @@ -70,4 +70,4 @@ jobs: run: dotnet build Atc.Azure.IoT.sln -c Release --no-restore /p:UseSourceLink=true - name: ๐Ÿงช Run unit tests - run: dotnet test -c Release --no-build --filter "Category!=Integration" \ No newline at end of file + run: dotnet test Atc.Azure.IoT.sln -c Release --no-build --filter "Category!=Integration" \ No newline at end of file