Skip to content

Conversation

@b-straub
Copy link
Contributor

@b-straub b-straub commented Jun 19, 2025

Correct fallback solution when 'FileVersionInfo.GetVersionInfo' is not available on a specific platform.
Synchronize versions.

Resolves #819

Correct fallback solution when 'FileVersionInfo.GetVersionInfo' is not available on a specific platform. Synchronize versions.
Correct fallback solution when 'FileVersionInfo.GetVersionInfo' is not available on a specific platform. Synchronize versions.
return fileVersionInfo.FileVersion
?? assembly.GetName().Version?.ToString() // will only change for major versions
?? "1.0.0.0";
try
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code introduced in this GitHub comment doesn't work for WebAssembly? The advantage was that we wouldn't need the try/catch. In both cases, caching the value would be advantageous.

Copy link
Contributor Author

@b-straub b-straub Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, was too fast with my fix. Working indeed, so you can throw away the pull request and replace with the suggested code.

<AssemblyOriginatorKeyFile>..\IcalNetStrongnameKey.snk</AssemblyOriginatorKeyFile>
<nullable>enable</nullable>
<LangVersion>latest</LangVersion>
<AssemblyVersion>2.0</AssemblyVersion>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All version attributes get set during publishing with the CI workflow.
Mixing up 2.0 with the iCalendar version defined in RFC 5545 Section 3.7.4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. Anyway obsolete see comment above.

}

return version ?? "1.0.0.0";
return version ?? "2.0";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see below regarding "2.0"

@axunonb
Copy link
Collaborator

axunonb commented Jun 19, 2025

Appreciate your feedback and PR. Why not update and we're done?
Hoping this is the only issue re WebAssembly

@b-straub
Copy link
Contributor Author

b-straub commented Jun 19, 2025

Appreciate your feedback and PR. Why not update and we're done? Hoping this is the only issue re WebAssembly

Done! I have a heavy solution to check. Will report when I find something else.

@sonarqubecloud
Copy link

@axunonb axunonb changed the title Fix for https://github.com/ical-org/ical.net/issues/819#issue-3156911979 Fix: Exception for Blazor WebAssembly using FileVersionInfo Jun 19, 2025
Copy link
Collaborator

@axunonb axunonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tnx

@axunonb axunonb merged commit 7556e7b into ical-org:main Jun 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception for Blazor WebAssembly using FileVersionInfo

2 participants