Skip to content

Conversation

@rido-min
Copy link
Member

Changed version retrieval in UserAgent property from Assembly.GetExecutingAssembly().GetName().Version to ThisAssembly.AssemblyFileVersion for improved accuracy.

This pull request makes a minor update to how the application version is determined for the UserAgent string. The code now uses ThisAssembly.AssemblyFileVersion instead of the executing assembly's version, which provides a more accurate and consistent version number.

(Libraries/Microsoft.Teams.Apps/App.csL49-R49)

Changed version retrieval in UserAgent property from
Assembly.GetExecutingAssembly().GetName().Version to
ThisAssembly.AssemblyFileVersion for improved accuracy.
Copilot AI review requested due to automatic review settings December 11, 2025 16:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the version retrieval mechanism for the UserAgent property in the App class. The change replaces the reflection-based approach (Assembly.GetExecutingAssembly().GetName().Version?.ToString()) with a compile-time constant from Nerdbank.GitVersioning (ThisAssembly.AssemblyFileVersion).

Key Changes:

  • Simplified version retrieval by using ThisAssembly.AssemblyFileVersion instead of runtime reflection
  • Leverages the Nerdbank.GitVersioning package already configured in the project

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
var version = Assembly.GetExecutingAssembly().GetName().Version?.ToString();
var version = ThisAssembly.AssemblyFileVersion;
version ??= "0.0.0";
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The null-coalescing assignment on line 50 is now dead code. ThisAssembly.AssemblyFileVersion returns a non-nullable string (generated by Nerdbank.GitVersioning), so the fallback to "0.0.0" will never execute. Consider either removing the null check or directly assigning the value without it.

Suggested change
version ??= "0.0.0";

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 00:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants