Closed kuacci closed 6 years ago
@kuacci this seems to be a known issue which has a fix steps in the comments - https://github.com/Azure/autorest/issues/1542
Hi @hovsepm - my workplace is the client. As @kuacci noted, both the workaround and the correct way of coding it (looking in the registsry instead of using reflection) are known. is there any reason the code snippet above can't be changed to look up the registry?
@MarkWhybird I believe this particular exception indicates a broken environment on the worker that can cause other issues and that is why the suggested direction is to fix the working environment instead of making this particular call "exceptionless". But I'll ask @SergeyKanzhelev and @wiktork to add more details if my explanation is not very precise.
If it's server app - follow the instructions in abovementined issue. Just update Application Insights extension or StatusMonitor in your environment.
If it's UWP app mentioned here I don't know the status.
@hovsepm,
Thank you for looking into this issue. As what I said this particular issue was caused by SCOM APM agent and we spent almost a month to figured out the cause. As you know that there are lots of 3rd party components which has the ability to inject into .net application like APM, dynatrace and others.
It would be very frustrated when troubleshooting this kind of issue. So I would like to check with you if it is possible to change the code above to a more safer way to get .net framework version?
Thanks,
@shahabhijeet could you take a look to the issue? it seems to be another hit for the parked fix in PR https://github.com/Azure/azure-sdk-for-net/pull/3752
@kuacci I am going to investigate this and have a resolution on this one soon. My hunch is, some SDK has included FileVersion attribtue multiple times. This could as simple as scanning for duplicate File version attributes.
Thank you @shahabhijeet
@kuacci there isn't anything in the clientruntime we can do to workaround this issue. We do not want to swallow the ambiguous exception as it affects basic clientruntime info in the request header for each SDK request. Not swallowing the exception made the real issue getting discovered in this case.
The following comment clarifies what was causing the issues in the first place. https://github.com/Azure/autorest/issues/1542#issuecomment-354811676
Workaround is to install the latest version of App insights extension should resolve the error you have reported and more information can be found in the following issue https://github.com/Azure/autorest/issues/1542
Sorry took longer than expected to respond to this issue.
I have to say that my issue has nothing to do with App Insights extension. As I said before, the issue was resolved after removed SCOM (System Center Configuration Manager) Application Monitor Agent which is another Microsoft product.
Maybe I should check with SCOM team, but I believe the change from your side would be the permanent solution for this kind of issue.
@kuacci I was skeptical, but sure enough, removing SCOM fixed this issue for me as well. I'm not an Azure user (I was using a different library that made a similar call) but I was experiencing this same exception. Removing SCOM resolved it.
Did you ever learn more about this or discover any other workarounds?
@justinhelgerson If removing SCOM can fix this issue for you then the root cause is SCOM. You asked for the other workaround, is that means you want SCOM Application monitor agent running? If that is true then you'd better to upgrade it to latest version. I am not sure if SCOM team has noticed this issue and released fix for it, but it's worth to try.
Hi guys,
My customer got System.Reflection.AmbiguousMatchException when when using latest version (2.3.10) of Microsoft.Rest.ClientRuntime: https://www.nuget.org/packages/Microsoft.Rest.ClientRuntime/
I captured dump against above above exception and it tells us the exception raised up when thread calling Microsoft.Rest.ServiceClient`1.get_FrameworkVersion()
The corresponding code of Rest is here:
This issue only happens on the IIS server which has SCOM APM installed, the exception just gone after removed SCOM APM agent. I believe this might caused by the APM injection which result in the above reflection code not working properly.
So I would like to know if you can change the above code to get .net framework version? Like the option introduced here to get .net framework version from registry?
Thanks