From cb665823d16aa3e5508a90458d529bf3452360e0 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Thu, 25 Jan 2024 17:18:42 +0000 Subject: [PATCH 1/3] support windows service --- .../MobileConfiguration.csproj | 1 + MobileConfiguration/Program.cs | 4 +++- .../MobileConfiguration.AssemblyInfo.cs | 2 +- ...bileConfiguration.AssemblyInfoInputs.cache | 2 +- ...nfiguration.csproj.AssemblyReference.cache | Bin 21141 -> 22521 bytes 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/MobileConfiguration/MobileConfiguration.csproj b/MobileConfiguration/MobileConfiguration.csproj index 90241dd..4165337 100644 --- a/MobileConfiguration/MobileConfiguration.csproj +++ b/MobileConfiguration/MobileConfiguration.csproj @@ -26,6 +26,7 @@ + diff --git a/MobileConfiguration/Program.cs b/MobileConfiguration/Program.cs index 1816903..f268aac 100644 --- a/MobileConfiguration/Program.cs +++ b/MobileConfiguration/Program.cs @@ -11,6 +11,7 @@ using NLog.Extensions.Logging; using Shared.Logger; using ILogger = Microsoft.Extensions.Logging.ILogger; +using Microsoft.Extensions.Hosting; IConfigurationRoot configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json") @@ -19,7 +20,8 @@ ConfigurationReader.Initialise(configuration); -var builder = WebApplication.CreateBuilder(args); +WebApplicationBuilder builder = WebApplication.CreateBuilder(args); +builder.Host.UseWindowsService(); String path = Assembly.GetExecutingAssembly().Location; path = Path.GetDirectoryName(path); builder.Configuration.SetBasePath(path) diff --git a/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfo.cs b/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfo.cs index fb60e31..4d3f657 100644 --- a/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfo.cs +++ b/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfo.cs @@ -15,7 +15,7 @@ [assembly: System.Reflection.AssemblyCompanyAttribute("MobileConfiguration")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5e1d892700cc5a07e9975ba1ab7840fdae666461")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1c0d46e9348057e31d15ed24738679c44ab75d91")] [assembly: System.Reflection.AssemblyProductAttribute("MobileConfiguration")] [assembly: System.Reflection.AssemblyTitleAttribute("MobileConfiguration")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfoInputs.cache b/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfoInputs.cache index fbabd4e..117a0cc 100644 --- a/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfoInputs.cache +++ b/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.AssemblyInfoInputs.cache @@ -1 +1 @@ -768756f091fd74ec1e9bc7c8ee981f773c5edc53 +4e4f3d00b6d9b30b9921496608a77b65b9cda61fefed2818649e8b6d44f892bf diff --git a/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.csproj.AssemblyReference.cache b/MobileConfiguration/obj/Debug/net7.0/MobileConfiguration.csproj.AssemblyReference.cache index 5d97a61f6db1d13aa7ee23c1bdf65413177b7a2c..5671ac47c6b81a0abf38603b31b2394fa978a800 100644 GIT binary patch delta 680 zcmbQbl=0_!Mh-ScRR#tI#-zy?mEnpd2epI5AxkzZVrnU}6t zo|%`DUtV0CT2z*qoLU@Xu4kZU5R;Rc6qA=)0_4Q_W+oTq7w4yy=(!?vdq8!ELv#m2 zb?c?%tfbisePa(#slRr9WOmR+0f--5TI5a5L zG4x7+ZN<=x2*t_qlA4p>2XKaiqZg+$A>pSFjCOrUwCiJ7h217_ShfZBX=D+r0Thfy GLCOH&hWjM| delta 28 kcmeylo^k3@Mh-ScWd;TY#-z!Ly7C* Date: Thu, 25 Jan 2024 17:29:56 +0000 Subject: [PATCH 2/3] :| --- .github/workflows/sonarcloud.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 0c73fa2..1951112 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -13,10 +13,11 @@ jobs: name: Build and analyze runs-on: windows-latest steps: - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK + uses: actions/setup-java@v4 with: - java-version: 1.11 + distribution: 'zulu' + java-version: 17 - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis From a5aaeb1c8cd6eb0a079bf651aa0f77705364bcf8 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Thu, 25 Jan 2024 17:36:20 +0000 Subject: [PATCH 3/3] Update sonarcloud.yml --- .github/workflows/sonarcloud.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1951112..76984e9 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -13,7 +13,7 @@ jobs: name: Build and analyze runs-on: windows-latest steps: - - name: Set up JDK + - name: Set up JDK uses: actions/setup-java@v4 with: distribution: 'zulu' @@ -49,4 +49,4 @@ jobs: .\.sonar\scanner\dotnet-sonarscanner begin /k:"TransactionProcessing_MobileConfiguration" /o:"transactionprocessing" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" dotnet restore MobileConfiguration.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} dotnet build MobileConfiguration.sln --configuration Release - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"