Skip to content

UserAgent header set in ServiceClient should include more detailed info #583

Closed

Description

Currently the user agent for all AutoRest-generated clients is set like this:

    HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(type.FullName,
         GetAssemblyVersion()));

Rather than use the assembly version, which is typically just a major version, it would be more useful to include the full semantic version of the client library (e.g. -- 6.13.1 instead of 6.0.0.0). This helps services use telemetry to track adoption of different versions of the client library.

Even better, ServiceClient could have a hook to let derived classes set their own UserAgent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

help wantedThis issue is tracking work for which community contributions would be welcomed and appreciated

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions