Skip to content

Commit

Permalink
fix: #43 appVersion is unknown in case Assembly.GetEntryAssembly() is…
Browse files Browse the repository at this point in the history
…… (#149)

… not set

Merging in public PR: #44

---------

Co-authored-by: ondrej.pajgrt <[email protected]>
  • Loading branch information
daniel-statsig and ondrej.pajgrt authored Jun 26, 2024
1 parent 053c3e8 commit 497d318
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion dotnet-statsig/src/Statsig/Client/ClientDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ IReadOnlyDictionary<string, string> 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,
Expand Down

0 comments on commit 497d318

Please sign in to comment.