azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] Invalid format of value when trying to instantiate a generic implementation of Microsoft.Rest.ServiceClient
I'm trying to instantiate an generic implementation of class which inherits from ServiceClient class.
Message: Test method Datora.Proxies.SAPServiceLayer.Client.Test.EntityUnit.Query threw exception: System.FormatException: The format of value 'Datora.Proxies.SAPServiceLayer.Client.SAPSLEntityProxy`1[[Datora.Proxies.SAPServiceLayer.Entities.BusinessPartner, Datora.Proxies.SAPServiceLayer.Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0020583cc5375c52]]' is invalid.
Stack Trace:
HeaderUtilities.CheckValidToken(String value, String parameterName) ProductHeaderValue.ctor(String name, String version) ServiceClient'1.InitializeHttpClient(HttpClientHandler httpClientHandler, DelegatingHandler[] handlers) ServiceClient'1.ctor(HttpClientHandler rootHandler, DelegatingHandler[] handlers) ServiceClient'1.ctor() ProxyBase.ctor() line 24 ProxyBase.ctor(IBasicClientConfigEntry _configuration) line 28 SAPSLProxyBase.ctor(SAPSLClientConfig _config) line 17 SAPSLEntityProxy'1.ctor(SAPSLClientConfig _config) line 15 SAPSLClient.GetEntityProxy[TEntity]() line 43 EntityUnit.Query() line 30 ThreadOperations.ExecuteWithAbortSafety(Action action)
I could see in ServiceClient source code that in InitializeHttpClient method the entry type name is used to fill ProductInfoHeaderValue instance which will be added as UserAgent client header.
What would be the issue here ? The length of full type name ? Is there a way to avoid this kind of issue without giving up a generic approach ?
Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'AutoRest Runtime:0.21352017,Storage:0.111607164,Azure.Core:0.102790676'
Hi @humbertosantiago. Would you please be so kind as to provide the name and version of the Azure SDK package that you're using?
Hi @jsquire , I'm using the package Microsoft.Rest.ClientRuntime 3.0.3.
@xboxeer, @m-nash: The class in question appears to be related to the mgmtcommon area in the v3 codegen. Would you please be so kind as to take a look and offer your thoughts?
Thank you, @humbertosantiago. I've looped in the team members best able to assist.
Hi @humbertosantiago , this package will deprecate from this Sept, could you please try our latest Track2 SDK. You could get start with: https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md
Hi @humbertosantiago. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @humbertosantiago, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!