From 497d3186fd98ba1960c16f1f2cb79fae4fc961de Mon Sep 17 00:00:00 2001 From: Daniel <95646168+daniel-statsig@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:09:33 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20#43=20appVersion=20is=20unknown=20in=20c?= =?UTF-8?q?ase=20Assembly.GetEntryAssembly()=20is=E2=80=A6=20(#149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … not set Merging in public PR: https://github.com/statsig-io/dotnet-sdk/pull/44 --------- Co-authored-by: ondrej.pajgrt --- .github/workflows/build-and-test.yml | 7 +++++-- dotnet-statsig/src/Statsig/Client/ClientDriver.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3236faf..7d70ecd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,21 +8,24 @@ on: jobs: build: + timeout-minutes: 10 runs-on: windows-latest steps: - uses: actions/checkout@v2 + - name: Setup .NET Core SDK uses: actions/setup-dotnet@v2 with: dotnet-version: "6.x.x" + - name: Install dependencies run: dotnet restore + - name: Build run: dotnet build --configuration Release --no-restore - timeout-minutes: 3 + - name: Test run: dotnet test --no-restore --verbosity normal - timeout-minutes: 5 env: test_api_key: ${{ secrets.SDK_CONSISTENCY_TEST_COMPANY_API_KEY }} test_client_key: ${{ secrets.SDK_CLIENT_KEY }} diff --git a/dotnet-statsig/src/Statsig/Client/ClientDriver.cs b/dotnet-statsig/src/Statsig/Client/ClientDriver.cs index 8eb7c1a..e2ca1d9 100644 --- a/dotnet-statsig/src/Statsig/Client/ClientDriver.cs +++ b/dotnet-statsig/src/Statsig/Client/ClientDriver.cs @@ -406,7 +406,7 @@ IReadOnlyDictionary GetStatsigMetadata() ["sessionID"] = _sessionID, ["stableID"] = PersistentStore.StableID, ["locale"] = CultureInfo.CurrentUICulture.Name, - ["appVersion"] = Assembly.GetEntryAssembly()!.GetName()!.Version!.ToString()!, + ["appVersion"] = Assembly.GetEntryAssembly()?.GetName().Version!.ToString() ?? "unknown", ["systemVersion"] = Environment.OSVersion.Version.ToString(), ["systemName"] = systemName, ["sdkType"] = sdkDetails.SDKType,