New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.NET] AmbiguousMatchException on initializing ServiceClient class #1542

Open
OlehUdovytskyi opened this Issue Oct 27, 2016 · 106 comments

Comments

Projects
None yet
@OlehUdovytskyi

OlehUdovytskyi commented Oct 27, 2016

Hi guys.

I have an issue with initializing my service client created by AutoRest and inherited from ServiceClient.

It throws AmbiguousMatchException and it arises in ServiceClient class.

[AmbiguousMatchException: Multiple custom attributes of the same type found.]
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +122
   Microsoft.Rest.ServiceClient`1.get_FrameworkVersion() +103
   Microsoft.Rest.ServiceClient`1.SetDefaultUserAgentInfo() +177
   Microsoft.Rest.ServiceClient`1.SetUserAgent(String productName, String version) +50
   Microsoft.Rest.ServiceClient`1..ctor(DelegatingHandler[] handlers) +61

It only appears on my Remote machine with Windows Server 2008 R2 Standart .NET Framework 4.6.1. Locally on Windows 10 Anniversary 4.6.2 Framework everything is ok.

In Microsoft.Rest.ServiceClient I've found next part of code in ClientVersion property getter:

try
          {
            AssemblyInformationalVersionAttribute customAttribute1 = assembly.GetCustomAttribute(typeof (AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute;
            this._clientVersion = customAttribute1 != null ? customAttribute1.InformationalVersion : (string) null;
            if (string.IsNullOrEmpty(this._clientVersion))
            {
              AssemblyFileVersionAttribute customAttribute2 = assembly.GetCustomAttribute(typeof (AssemblyFileVersionAttribute)) as AssemblyFileVersionAttribute;
              this._clientVersion = customAttribute2 != null ? customAttribute2.Version : (string) null;
            }
          }
          catch (AmbiguousMatchException ex)
          {
          }

I think it is source of my problem but I don't understand why it occurs and to handle it. I see that current exception must be caught but I don't have any other ideas what else can be wrong.

Guys, any ideas ?

@shaunol

This comment has been minimized.

Show comment
Hide comment
@shaunol

shaunol Nov 9, 2016

I'm also having this same problem. Working fine on my Windows 10 development workstation but when I deploy to my Server 2012 environment, I get the above exception. I also can't seem to find the source code for the Microsoft.Rest.ClientRuntime package to try to debug. I can't really make heads or tails of this issue.

shaunol commented Nov 9, 2016

I'm also having this same problem. Working fine on my Windows 10 development workstation but when I deploy to my Server 2012 environment, I get the above exception. I also can't seem to find the source code for the Microsoft.Rest.ClientRuntime package to try to debug. I can't really make heads or tails of this issue.

@shaunol

This comment has been minimized.

Show comment
Hide comment
@shaunol

shaunol Nov 9, 2016

Downgrading Microsoft.Rest.ClientRuntime from 2.3.3 to 2.3.2 has fixed the issue for me.

shaunol commented Nov 9, 2016

Downgrading Microsoft.Rest.ClientRuntime from 2.3.3 to 2.3.2 has fixed the issue for me.

@opterios

This comment has been minimized.

Show comment
Hide comment
@opterios

opterios Nov 9, 2016

I had exactly the same issue with shaunol (on Windows 8 it was fine, on Windows 2012 it was not working) while trying to make calls to AzureBatch. I was getting the following exception:

Message='Multiple custom attributes of the same type found. at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
 at Microsoft.Rest.ServiceClient1.get_FrameworkVersion()
 at Microsoft.Rest.ServiceClient1.SetDefaultUserAgentInfo()
 at Microsoft.Rest.ServiceClient1.SetUserAgent(String productName, String version)
 at Microsoft.Rest.ServiceClient1.InitializeHttpClient(HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)


and downgrading to 2.3.2 resolved the issue!

Thanks for your help!

opterios commented Nov 9, 2016

I had exactly the same issue with shaunol (on Windows 8 it was fine, on Windows 2012 it was not working) while trying to make calls to AzureBatch. I was getting the following exception:

Message='Multiple custom attributes of the same type found. at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
 at Microsoft.Rest.ServiceClient1.get_FrameworkVersion()
 at Microsoft.Rest.ServiceClient1.SetDefaultUserAgentInfo()
 at Microsoft.Rest.ServiceClient1.SetUserAgent(String productName, String version)
 at Microsoft.Rest.ServiceClient1.InitializeHttpClient(HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)


and downgrading to 2.3.2 resolved the issue!

Thanks for your help!

@robpex

This comment has been minimized.

Show comment
Hide comment
@robpex

robpex Nov 9, 2016

Adding info from my troubleshooting this problem.

In my case, the "Application Insights Monitor" (https://github.com/Azure/azure-content/blob/master/articles/application-insights/app-insights-monitor-performance-live-website-now.md) was injecting an additional "AssemblyFileVersionAttribute" value into mscorlib.dll. So, the Microsoft.Rest.ClientRuntime error makes sense because when it tries to get the file version using that attribute, it is, in fact, ambiguous.

  1. Does it ever make sense to have more than one "AssemblyFileVersionAttribute" on any file? If not, there's at least a bug in the tool I just mentioned.

  2. Regardless of the answer to number 1, you'll see that the code for Microsoft.Rest.ClientRuntime tries to use "AssemblyFileVersionAttribute" more than once. In one instance, it catches and ignores AmbiguousReferenceException and in other instances, it is not. I believe it should be consistent. Either it's always safe to ignore it, or it's not.

robpex commented Nov 9, 2016

Adding info from my troubleshooting this problem.

In my case, the "Application Insights Monitor" (https://github.com/Azure/azure-content/blob/master/articles/application-insights/app-insights-monitor-performance-live-website-now.md) was injecting an additional "AssemblyFileVersionAttribute" value into mscorlib.dll. So, the Microsoft.Rest.ClientRuntime error makes sense because when it tries to get the file version using that attribute, it is, in fact, ambiguous.

  1. Does it ever make sense to have more than one "AssemblyFileVersionAttribute" on any file? If not, there's at least a bug in the tool I just mentioned.

  2. Regardless of the answer to number 1, you'll see that the code for Microsoft.Rest.ClientRuntime tries to use "AssemblyFileVersionAttribute" more than once. In one instance, it catches and ignores AmbiguousReferenceException and in other instances, it is not. I believe it should be consistent. Either it's always safe to ignore it, or it's not.

@shaunol

This comment has been minimized.

Show comment
Hide comment
@shaunol

shaunol Nov 9, 2016

Noting that I also have Application Insights Monitor installed on my Server 2012 instance that is exhibiting this behaviour. Really good catch.

shaunol commented Nov 9, 2016

Noting that I also have Application Insights Monitor installed on my Server 2012 instance that is exhibiting this behaviour. Really good catch.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

@RobpleX, Application Insights do not inject any attributes into mscorlib. What made you make this conclusion?

Application Insights do make some code injections. But I cannot think of any that will make the custom attributes reading logic to fail. Do you have a small repro I can try out?

Member

SergeyKanzhelev commented Nov 30, 2016

@RobpleX, Application Insights do not inject any attributes into mscorlib. What made you make this conclusion?

Application Insights do make some code injections. But I cannot think of any that will make the custom attributes reading logic to fail. Do you have a small repro I can try out?

@robpex

This comment has been minimized.

Show comment
Hide comment
@robpex

robpex Nov 30, 2016

@SergeyKanzhelev the way I reproduced it was by debugging my code and at the breakpoint (I don't think the breakpoint location is important), running the following in an immediate window:
System.Attribute.GetCustomAttributes((typeof(object)).Assembly).

From there, I was able to see multiple {System.Reflection.AssemblyFileVersionAttribute} with different values and when I uninstall Application Insights, this was no longer the case. I'm sure there are other ways of getting at those properties for mscorlib, but this is what caused me to make this conclusion.

I saw Microsoft in your profile...are you directly involved with Application Insights?

robpex commented Nov 30, 2016

@SergeyKanzhelev the way I reproduced it was by debugging my code and at the breakpoint (I don't think the breakpoint location is important), running the following in an immediate window:
System.Attribute.GetCustomAttributes((typeof(object)).Assembly).

From there, I was able to see multiple {System.Reflection.AssemblyFileVersionAttribute} with different values and when I uninstall Application Insights, this was no longer the case. I'm sure there are other ways of getting at those properties for mscorlib, but this is what caused me to make this conclusion.

I saw Microsoft in your profile...are you directly involved with Application Insights?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

@robpex yes, I am working on Application Insights. Do you happen to have a small repro I can try out? I'll check the collection System.Attribute.GetCustomAttributes((typeof(object)).Assembly) on my apps now and report back.

Member

SergeyKanzhelev commented Nov 30, 2016

@robpex yes, I am working on Application Insights. Do you happen to have a small repro I can try out? I'll check the collection System.Attribute.GetCustomAttributes((typeof(object)).Assembly) on my apps now and report back.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

Ok. I got a repro. We will investigate

Member

SergeyKanzhelev commented Nov 30, 2016

Ok. I got a repro. We will investigate

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

BTW, this is the magic we are trying to make with the status monitor if you are interested: http://apmtips.com/blog/2016/11/18/how-application-insights-status-monitor-not-monitors-dependencies/

If you want to keep using application insights - you can disable profiler and only use Application Insights SDK. It will still collect interesting telemetry. Let me know if you need help configuring it

Member

SergeyKanzhelev commented Nov 30, 2016

BTW, this is the magic we are trying to make with the status monitor if you are interested: http://apmtips.com/blog/2016/11/18/how-application-insights-status-monitor-not-monitors-dependencies/

If you want to keep using application insights - you can disable profiler and only use Application Insights SDK. It will still collect interesting telemetry. Let me know if you need help configuring it

@robpex

This comment has been minimized.

Show comment
Hide comment
@robpex

robpex Nov 30, 2016

@SergeyKanzhelev ok, cool. I can't share the code (company policies), but I'm happy to discuss further since I dug pretty deep on this one. :) I suspect there's still something to be fixed in the autorest side as well as I mentioned above in number 2. My initial thought was to catch/ignore the exception like it's doing elsewhere, but I don't know if that's the best approach. I don't know if you're involved with this project though, but perhaps you know someone. I wasn't sure who to tell. :)

robpex commented Nov 30, 2016

@SergeyKanzhelev ok, cool. I can't share the code (company policies), but I'm happy to discuss further since I dug pretty deep on this one. :) I suspect there's still something to be fixed in the autorest side as well as I mentioned above in number 2. My initial thought was to catch/ignore the exception like it's doing elsewhere, but I don't know if that's the best approach. I don't know if you're involved with this project though, but perhaps you know someone. I wasn't sure who to tell. :)

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

I looked at the list of contributors and I only know one person there. I think the issue is clearly related to Application Insights and needs to be fixed on our side. After that no additional exception handling will be needed. But I didn't dug deep, just initial thoughts

Member

SergeyKanzhelev commented Nov 30, 2016

I looked at the list of contributors and I only know one person there. I think the issue is clearly related to Application Insights and needs to be fixed on our side. After that no additional exception handling will be needed. But I didn't dug deep, just initial thoughts

@brjohnstmsft

This comment has been minimized.

Show comment
Hide comment
@brjohnstmsft
Member

brjohnstmsft commented Dec 1, 2016

Possibly related: Azure/azure-sdk-for-net#2516

@brjohnstmsft

This comment has been minimized.

Show comment
Hide comment
@brjohnstmsft

brjohnstmsft Dec 8, 2016

Member

@SergeyKanzhelev Are you investigating this issue? I'm getting more reports of customers being affected.

Member

brjohnstmsft commented Dec 8, 2016

@SergeyKanzhelev Are you investigating this issue? I'm getting more reports of customers being affected.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Dec 8, 2016

Member

We know the root cause and working on a fix. We expect the fix shipped next week. Meanwhile the work around is to disable Application Insights Azure WebSite extension or StatusMonitor. Please escalate using CSS channel if you need a hotfix sooner.

Member

SergeyKanzhelev commented Dec 8, 2016

We know the root cause and working on a fix. We expect the fix shipped next week. Meanwhile the work around is to disable Application Insights Azure WebSite extension or StatusMonitor. Please escalate using CSS channel if you need a hotfix sooner.

@jimt4593

This comment has been minimized.

Show comment
Hide comment
@jimt4593

jimt4593 Dec 20, 2016

Status Monitor somehow causes AmbiguousMatchException exception on AutoRest apps #241 is the issue that @SergeyKanzhelev is referring to.

The issue is marked closed and mentions Application Insights 2.2.0. Can someone confirm that updating to Application Insights 2.2.0 fixes this issue?

jimt4593 commented Dec 20, 2016

Status Monitor somehow causes AmbiguousMatchException exception on AutoRest apps #241 is the issue that @SergeyKanzhelev is referring to.

The issue is marked closed and mentions Application Insights 2.2.0. Can someone confirm that updating to Application Insights 2.2.0 fixes this issue?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Dec 20, 2016

Member

@jimt4593 the issue you mentioned is still open. We released a fix fro Azure Web Apps and working on on-premisis Status Monitor.

We will also appreciate a confirmation that the fix actually worked.

Member

SergeyKanzhelev commented Dec 20, 2016

@jimt4593 the issue you mentioned is still open. We released a fix fro Azure Web Apps and working on on-premisis Status Monitor.

We will also appreciate a confirmation that the fix actually worked.

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa Dec 21, 2016

Never worked. Only way I could get it to work is to have a new asp.net project which does not use app insights and when deploying the cloud service - do not enable sending telemetry. If you do, error still happens.

SOMEONE FIX THIS SOON PLEASE!!!

vdevappa commented Dec 21, 2016

Never worked. Only way I could get it to work is to have a new asp.net project which does not use app insights and when deploying the cloud service - do not enable sending telemetry. If you do, error still happens.

SOMEONE FIX THIS SOON PLEASE!!!

@arnaudauroux

This comment has been minimized.

Show comment
Hide comment
@arnaudauroux

arnaudauroux Jan 6, 2017

Any update on this @SergeyKanzhelev ? I am also experiencing the same issue with the Azure Search Library and Asp.Net Core
"Microsoft.Azure.Search": "3.0.1",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",

arnaudauroux commented Jan 6, 2017

Any update on this @SergeyKanzhelev ? I am also experiencing the same issue with the Azure Search Library and Asp.Net Core
"Microsoft.Azure.Search": "3.0.1",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa Jan 6, 2017

These bozos at Microsoft do not reply. They screw everyone up and they shut their mouths and we are suffering because of it - marketing says - hey! everyone c'mon use our services!

Guys, don't keep referencing these s!@#$%y links which take you on a merry go around. We don't have the time to crawl the entire internet trying to figure out how to fix the s#$t you broke.

This is supposed to be enterprise search capability - not corner mom & pop shop search which you can break like this and keep broken for 17 #@#$%^& days.

Anyway...

What I ended up doing - this is the only way to get this c@#p to work - created another project - without application insights referenced in it and then put my search code there and it works.

If you remove, uninstall app insights packages - still does not work - I already tried it.

Only caveat, the wizard keeps prompting to select the app insights when you try to deploy the cloud service everytime - but I can live with that.

vdevappa commented Jan 6, 2017

These bozos at Microsoft do not reply. They screw everyone up and they shut their mouths and we are suffering because of it - marketing says - hey! everyone c'mon use our services!

Guys, don't keep referencing these s!@#$%y links which take you on a merry go around. We don't have the time to crawl the entire internet trying to figure out how to fix the s#$t you broke.

This is supposed to be enterprise search capability - not corner mom & pop shop search which you can break like this and keep broken for 17 #@#$%^& days.

Anyway...

What I ended up doing - this is the only way to get this c@#p to work - created another project - without application insights referenced in it and then put my search code there and it works.

If you remove, uninstall app insights packages - still does not work - I already tried it.

Only caveat, the wizard keeps prompting to select the app insights when you try to deploy the cloud service everytime - but I can live with that.

@arnaudauroux

This comment has been minimized.

Show comment
Hide comment
@arnaudauroux

arnaudauroux Jan 6, 2017

@vdevappa I have downgraded Microsoft.Azure.Search from 3.0.1 to 1.1.3 and it solved the problem ;)

arnaudauroux commented Jan 6, 2017

@vdevappa I have downgraded Microsoft.Azure.Search from 3.0.1 to 1.1.3 and it solved the problem ;)

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa Jan 6, 2017

Ya, not a great solution I think to downgrade search for a reason which is not even remotely related to it (app insights). I went the other way.

vdevappa commented Jan 6, 2017

Ya, not a great solution I think to downgrade search for a reason which is not even remotely related to it (app insights). I went the other way.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jan 6, 2017

Member

@vdevappa @arnaudauroux in what environment you are running the application? You don't need to know these details, but there are two pieces of Application Insights - SDK that you install with the application and agent that you install. In Azure Web Sites - agent is deployed by WebSite extension, in Cloud Services by WAD and in other cased for regular IIS - by Application Insights Status Monitor. We updated extension 17 days ago and Status Monitor yesterday. WAD update is pending as we need to test is as well.

So you'd need to update an agent, not only uninstall Application Insights. I still didn't get confirmation from anybody that the issue was actually fixed after update and will appreciate if you'll try it out.

Member

SergeyKanzhelev commented Jan 6, 2017

@vdevappa @arnaudauroux in what environment you are running the application? You don't need to know these details, but there are two pieces of Application Insights - SDK that you install with the application and agent that you install. In Azure Web Sites - agent is deployed by WebSite extension, in Cloud Services by WAD and in other cased for regular IIS - by Application Insights Status Monitor. We updated extension 17 days ago and Status Monitor yesterday. WAD update is pending as we need to test is as well.

So you'd need to update an agent, not only uninstall Application Insights. I still didn't get confirmation from anybody that the issue was actually fixed after update and will appreciate if you'll try it out.

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa Jan 6, 2017

I use cloud services. I know the last release did not work as you mention (WAD) because it is pending.

vdevappa commented Jan 6, 2017

I use cloud services. I know the last release did not work as you mention (WAD) because it is pending.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jan 6, 2017

Member

In cloud services - did you enable Application Insights using WAD (Diagnostics Settings window in Visual Studio) or using a startup task?

Member

SergeyKanzhelev commented Jan 6, 2017

In cloud services - did you enable Application Insights using WAD (Diagnostics Settings window in Visual Studio) or using a startup task?

@arnaudauroux

This comment has been minimized.

Show comment
Hide comment
@arnaudauroux

arnaudauroux Jan 6, 2017

I use Azure Web App

arnaudauroux commented Jan 6, 2017

I use Azure Web App

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa Jan 6, 2017

In cloud services, Application Insights was enabled a weeks ago (before I implemented search) using right click > configure/ install application insights.

vdevappa commented Jan 6, 2017

In cloud services, Application Insights was enabled a weeks ago (before I implemented search) using right click > configure/ install application insights.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev May 9, 2017

Member

I double checked Status Monitor. This bug is definitely fixed in v 9.1.0.0. Direct download link. This version will be installed by platform installer. I'm not sure why it wasn't picked up in your environment.

image

Versions of MicrosoftInstrumentationEngine_x64.dll under C:\Program Files\Microsoft Application Insights\Runtime Instrumentation Agent\x64 should be 0.1.22.16258 or above. Assembly Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll in the same folder should NOT have AssemblyFileVersionAttribute attribute.

Member

SergeyKanzhelev commented May 9, 2017

I double checked Status Monitor. This bug is definitely fixed in v 9.1.0.0. Direct download link. This version will be installed by platform installer. I'm not sure why it wasn't picked up in your environment.

image

Versions of MicrosoftInstrumentationEngine_x64.dll under C:\Program Files\Microsoft Application Insights\Runtime Instrumentation Agent\x64 should be 0.1.22.16258 or above. Assembly Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll in the same folder should NOT have AssemblyFileVersionAttribute attribute.

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa May 9, 2017

Is this issue fixed for those unfortunate ones (like me) who use the SDK and cloud services?

vdevappa commented May 9, 2017

Is this issue fixed for those unfortunate ones (like me) who use the SDK and cloud services?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev May 9, 2017

Member

@vdevappa, yes. Windows Azure Diagnostics on cloud services will install the correct version of Status Monitor. Please let me know if you still experience the issue

Member

SergeyKanzhelev commented May 9, 2017

@vdevappa, yes. Windows Azure Diagnostics on cloud services will install the correct version of Status Monitor. Please let me know if you still experience the issue

@vdevappa

This comment has been minimized.

Show comment
Hide comment
@vdevappa

vdevappa May 9, 2017

Thanks, that explains why the issues are resolved for me now.

vdevappa commented May 9, 2017

Thanks, that explains why the issues are resolved for me now.

@SvenAelterman

This comment has been minimized.

Show comment
Hide comment
@SvenAelterman

SvenAelterman Jun 13, 2017

FYI: I have an Azure Web App that uses Key Vault quite extensively and with updating to the latest App Insights SDK (coming from a v1) this issue popped up. I then upgraded the App Insights Extension to the latest (2.3.2) but no avail. I uninstalled the extension and restarted the app and the app works. I reinstalled the extension, restarted the app again and the app is now still working.
So apparently upgrading the Extension does not suffice, it must be removed and reinstalled.

This is happening on all 3 instances of my app. No issues locally on Win10 dev workstations.
Following Application Insights related NuGet packages are referenced in the app:

  • Microsoft.ApplicationInsights 2.3.0
  • Microsoft.ApplicationInsights.Agent.Intercept 2.0.7
  • Microsoft.ApplicationInsights.DependencyCollector 2.3.0
  • Microsoft.ApplicationInsights.PerfCounterCollector 2.3.0
  • Microsoft.ApplicationInsights.TraceListener 2.2.0
  • Microsoft.ApplicationInsights.Web 2.3.0
  • Microsoft.ApplicationInsights.WindowsServer 2.3.0
  • Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.3.0

The app targets .NET Framework 4.6.1.

SvenAelterman commented Jun 13, 2017

FYI: I have an Azure Web App that uses Key Vault quite extensively and with updating to the latest App Insights SDK (coming from a v1) this issue popped up. I then upgraded the App Insights Extension to the latest (2.3.2) but no avail. I uninstalled the extension and restarted the app and the app works. I reinstalled the extension, restarted the app again and the app is now still working.
So apparently upgrading the Extension does not suffice, it must be removed and reinstalled.

This is happening on all 3 instances of my app. No issues locally on Win10 dev workstations.
Following Application Insights related NuGet packages are referenced in the app:

  • Microsoft.ApplicationInsights 2.3.0
  • Microsoft.ApplicationInsights.Agent.Intercept 2.0.7
  • Microsoft.ApplicationInsights.DependencyCollector 2.3.0
  • Microsoft.ApplicationInsights.PerfCounterCollector 2.3.0
  • Microsoft.ApplicationInsights.TraceListener 2.2.0
  • Microsoft.ApplicationInsights.Web 2.3.0
  • Microsoft.ApplicationInsights.WindowsServer 2.3.0
  • Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.3.0

The app targets .NET Framework 4.6.1.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jun 14, 2017

Member

@iusafaro why update may behave the way @SvenAelterman reported? Is it a bug or special case?

Member

SergeyKanzhelev commented Jun 14, 2017

@iusafaro why update may behave the way @SvenAelterman reported? Is it a bug or special case?

@roboffer

This comment has been minimized.

Show comment
Hide comment
@roboffer

roboffer Dec 21, 2017

We are currently seeing this issue in Azure on a site which does use Application Insights. Originally we enabled this in the portal but more recently have bundled it in with our project after the monitoring stopped working.

We experienced the error suddenly without warning when our web app was switched instances in the early hours of the morning yesterday.

I was able to mitigate it by redeploying the same code base to our staging deployment slot and then swapping that with live. That means we do have an environment up on staging that the error still is persisted in if that helps to diagnose anything.

This is initiated by Mongo in our dependency injection code where it attempts to get the framework description.

[AmbiguousMatchException: Multiple custom attributes of the same type found.]
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +110
   System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription() +87
   MongoDB.Driver.Core.Connections.ClientDocumentHelper.GetPlatformString() +9

I have a support case open with Azure support at the moment.

roboffer commented Dec 21, 2017

We are currently seeing this issue in Azure on a site which does use Application Insights. Originally we enabled this in the portal but more recently have bundled it in with our project after the monitoring stopped working.

We experienced the error suddenly without warning when our web app was switched instances in the early hours of the morning yesterday.

I was able to mitigate it by redeploying the same code base to our staging deployment slot and then swapping that with live. That means we do have an environment up on staging that the error still is persisted in if that helps to diagnose anything.

This is initiated by Mongo in our dependency injection code where it attempts to get the framework description.

[AmbiguousMatchException: Multiple custom attributes of the same type found.]
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +110
   System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription() +87
   MongoDB.Driver.Core.Connections.ClientDocumentHelper.GetPlatformString() +9

I have a support case open with Azure support at the moment.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Dec 21, 2017

Member

@roboffer what version of Application Insights extension do you have installed?

@iusafaro @WilliamXieMSFT I wonder can this be a regression with the recently shipped extension version?

Member

SergeyKanzhelev commented Dec 21, 2017

@roboffer what version of Application Insights extension do you have installed?

@iusafaro @WilliamXieMSFT I wonder can this be a regression with the recently shipped extension version?

@puneetg1983

This comment has been minimized.

Show comment
Hide comment
@puneetg1983

puneetg1983 Dec 22, 2017

I am also engaged on issue for Azure WebApps where things are failing for a particular slot only and they are using MongoDb driver (looks like it is @roboffer only )

We collected a memory dump on this exception and I see the following DLL's and versions loaded

Image name: Microsoft.ApplicationInsights.NLogTarget.dll
Product version:  2.4.1.441
Image name: Microsoft.ApplicationInsights.dll
Product version:  2.4.0.32153
Image name: 2.4.0.0.Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll
Product version:  2.4.0.40021
Image name: Microsoft.ApplicationInsights.Extensions.Base_x86.dll
Product version:  2.0.0.205
Image name: Microsoft.ApplicationInsights.ExtensionsHost.dll
Product version:  2.0.0.205

Does this help ?

puneetg1983 commented Dec 22, 2017

I am also engaged on issue for Azure WebApps where things are failing for a particular slot only and they are using MongoDb driver (looks like it is @roboffer only )

We collected a memory dump on this exception and I see the following DLL's and versions loaded

Image name: Microsoft.ApplicationInsights.NLogTarget.dll
Product version:  2.4.1.441
Image name: Microsoft.ApplicationInsights.dll
Product version:  2.4.0.32153
Image name: 2.4.0.0.Microsoft.ApplicationInsights.Extensions.Intercept_x86.dll
Product version:  2.4.0.40021
Image name: Microsoft.ApplicationInsights.Extensions.Base_x86.dll
Product version:  2.0.0.205
Image name: Microsoft.ApplicationInsights.ExtensionsHost.dll
Product version:  2.0.0.205

Does this help ?

@wiktork

This comment has been minimized.

Show comment
Hide comment
@wiktork

wiktork Dec 22, 2017

@puneetg1983 For the app service scenario, the newest dll's should be Microsoft.InstrumentationEngine.Extensions.Base_x86.dll and Microsoft.InstrumentationEngine.ExtensionsHost_x64. (Note the name changes). Both should be version 1.0.3+. Can you update to the latest version of ApplicationInsights on this slot?

wiktork commented Dec 22, 2017

@puneetg1983 For the app service scenario, the newest dll's should be Microsoft.InstrumentationEngine.Extensions.Base_x86.dll and Microsoft.InstrumentationEngine.ExtensionsHost_x64. (Note the name changes). Both should be version 1.0.3+. Can you update to the latest version of ApplicationInsights on this slot?

@roboffer

This comment has been minimized.

Show comment
Hide comment
@roboffer

roboffer Jan 2, 2018

@SergeyKanzhelev AFAIK we are using the latest application insights versions, they are installed through NuGet and it shows the versions that are installed are as follows:

Microsoft.ApplicationInsights v2.4.0
Microsoft.ApplicationInsights.Agent.Intercept v2.4.0
Microsoft.ApplicationInsights.DependencyCollector v2.4.1
Microsoft.ApplicationInsights.NLogTarget v2.4.1
Microsoft.ApplicationInsights.PerfCounterCollector v2.4.1
Microsoft.ApplicationInsights.Web v2.4.1
Microsoft.ApplicationInsights.WindowsServer v2.4.1
Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel v2.4.0

What I did just notice is that our staging environment did have Application Insights installed on it as a Site Extension through Kudu and live didn't (however this problem originally happened on live before swapping the slots to resolve). The installed version was 2.0.0, removing this entirely or updating it to the latest version 2.4.7 made no difference and the problem still persists.

After this update I have found DLLs matching those outlined by @wiktork (Microsoft.InstrumentationEngine.ExtensionsHost_x64 v1.3.3.37395 and Microsoft.InstrumentationEngine.Extensions.Base_x86 v1.3.3.37395) in the SiteExtensions folder. I can't confirm what versions were there before.

Without knowing the full details it seems that some code is asking for attributes from a class that has multiple of the same custom attribute. Is the fix to handle that error in the code that is asking for the attributes or is the fix to remove the additional attribute?

roboffer commented Jan 2, 2018

@SergeyKanzhelev AFAIK we are using the latest application insights versions, they are installed through NuGet and it shows the versions that are installed are as follows:

Microsoft.ApplicationInsights v2.4.0
Microsoft.ApplicationInsights.Agent.Intercept v2.4.0
Microsoft.ApplicationInsights.DependencyCollector v2.4.1
Microsoft.ApplicationInsights.NLogTarget v2.4.1
Microsoft.ApplicationInsights.PerfCounterCollector v2.4.1
Microsoft.ApplicationInsights.Web v2.4.1
Microsoft.ApplicationInsights.WindowsServer v2.4.1
Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel v2.4.0

What I did just notice is that our staging environment did have Application Insights installed on it as a Site Extension through Kudu and live didn't (however this problem originally happened on live before swapping the slots to resolve). The installed version was 2.0.0, removing this entirely or updating it to the latest version 2.4.7 made no difference and the problem still persists.

After this update I have found DLLs matching those outlined by @wiktork (Microsoft.InstrumentationEngine.ExtensionsHost_x64 v1.3.3.37395 and Microsoft.InstrumentationEngine.Extensions.Base_x86 v1.3.3.37395) in the SiteExtensions folder. I can't confirm what versions were there before.

Without knowing the full details it seems that some code is asking for attributes from a class that has multiple of the same custom attribute. Is the fix to handle that error in the code that is asking for the attributes or is the fix to remove the additional attribute?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jan 2, 2018

Member

@roboffer Application Insights consists of two parts. One is SDK, another one is additional code instrumentation that is enabled by site extension. That additional code instrumentation makes possible to improve data collection in runtime. Some details in my blog post.

The problem is that older version of that extension by mistake added extra attributes to assembly metadata. This caused problems with AutoRest library as that library expects certain attributes to be defined exactly once.

Please confirm that the issue got fixed after upgrade.

Member

SergeyKanzhelev commented Jan 2, 2018

@roboffer Application Insights consists of two parts. One is SDK, another one is additional code instrumentation that is enabled by site extension. That additional code instrumentation makes possible to improve data collection in runtime. Some details in my blog post.

The problem is that older version of that extension by mistake added extra attributes to assembly metadata. This caused problems with AutoRest library as that library expects certain attributes to be defined exactly once.

Please confirm that the issue got fixed after upgrade.

@roboffer

This comment has been minimized.

Show comment
Hide comment
@roboffer

roboffer Jan 3, 2018

@SergeyKanzhelev Thanks, that makes sense with what I thought might be happening (changes were being made to a different assembly). Do you know exactly which assembly would have been modified?

We are still seeing the issue after upgrading, but if the assembly that was modified was a system DLL then I'm assuming upgrading won't remove the invalid attribute?

roboffer commented Jan 3, 2018

@SergeyKanzhelev Thanks, that makes sense with what I thought might be happening (changes were being made to a different assembly). Do you know exactly which assembly would have been modified?

We are still seeing the issue after upgrading, but if the assembly that was modified was a system DLL then I'm assuming upgrading won't remove the invalid attribute?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jan 3, 2018

Member

@roboffer attributes only inserted in runtime in-memory. Not on disk. So upgrade of extension should fix the issue. Have you restarted app after an upgrade of extension?

Member

SergeyKanzhelev commented Jan 3, 2018

@roboffer attributes only inserted in runtime in-memory. Not on disk. So upgrade of extension should fix the issue. Have you restarted app after an upgrade of extension?

@jblackwell-thuzi

This comment has been minimized.

Show comment
Hide comment
@jblackwell-thuzi

jblackwell-thuzi Jan 3, 2018

@SergeyKanzhelev I've run into this issue today while deploying to a production web app. In the staging environment I do not get this error, this environment doesn't have AI extension installed. I tried updating the AI web extension but that didn't fix the issue. This does seem to be associated with the mongo driver. Any suggestions are appreciated as this is supposed to be public tomorrow.

[AmbiguousMatchException: Multiple custom attributes of the same type found.]
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +119
   System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription() +127
   System.Lazy`1.CreateValue() +730
   System.Lazy`1.LazyInitValue() +438
   MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateClientDocument(String applicationName) +76
   MongoDB.Driver.Core.Connections.BinaryConnectionFactory..ctor(ConnectionSettings settings, IStreamFactory streamFactory, IEventSubscriber eventSubscriber) +176
   MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster() +172
   MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey) +486
   MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey) +113
   MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings) +118
   SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext..cctor() +103

[TypeInitializationException: The type initializer for 'SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext' threw an exception.]
   SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext..ctor() +0
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController..cctor() +44

[TypeInitializationException: The type initializer for 'SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController' threw an exception.]
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController.GetTotals() +36
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController.Insert(EntreeFavoriteModel survey) +92
   lambda_method(Closure , ControllerBase , Object[] ) +175
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +209
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +80
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +906
   Telerik.Sitefinity.Mvc.ControllerWrapper.Execute() +217
   Telerik.Sitefinity.Mvc.ControllerActionInvoker.ExecuteController(MvcProxyBase proxyControl) +227
   Telerik.Sitefinity.Mvc.ControllerActionInvoker.TryInvokeAction(MvcProxyBase proxyControl, String& output) +311
   Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.ExecuteController() +66
   System.Web.UI.Control.PreRenderRecursiveInternal() +200
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7487

jblackwell-thuzi commented Jan 3, 2018

@SergeyKanzhelev I've run into this issue today while deploying to a production web app. In the staging environment I do not get this error, this environment doesn't have AI extension installed. I tried updating the AI web extension but that didn't fix the issue. This does seem to be associated with the mongo driver. Any suggestions are appreciated as this is supposed to be public tomorrow.

[AmbiguousMatchException: Multiple custom attributes of the same type found.]
   System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) +119
   System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription() +127
   System.Lazy`1.CreateValue() +730
   System.Lazy`1.LazyInitValue() +438
   MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateClientDocument(String applicationName) +76
   MongoDB.Driver.Core.Connections.BinaryConnectionFactory..ctor(ConnectionSettings settings, IStreamFactory streamFactory, IEventSubscriber eventSubscriber) +176
   MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster() +172
   MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey) +486
   MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey) +113
   MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings) +118
   SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext..cctor() +103

[TypeInitializationException: The type initializer for 'SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext' threw an exception.]
   SitefinityWebApp.Mvc.Models.ContextModels.SurveyContext..ctor() +0
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController..cctor() +44

[TypeInitializationException: The type initializer for 'SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController' threw an exception.]
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController.GetTotals() +36
   SitefinityWebApp.Mvc.Controllers.EntreeFavoriteSurveyController.Insert(EntreeFavoriteModel survey) +92
   lambda_method(Closure , ControllerBase , Object[] ) +175
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +209
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +80
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +452
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +906
   Telerik.Sitefinity.Mvc.ControllerWrapper.Execute() +217
   Telerik.Sitefinity.Mvc.ControllerActionInvoker.ExecuteController(MvcProxyBase proxyControl) +227
   Telerik.Sitefinity.Mvc.ControllerActionInvoker.TryInvokeAction(MvcProxyBase proxyControl, String& output) +311
   Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.ExecuteController() +66
   System.Web.UI.Control.PreRenderRecursiveInternal() +200
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Control.PreRenderRecursiveInternal() +297
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7487
@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Jan 3, 2018

Member

@wiktork can it be that extension didn't clean up older binaries after update?

Member

SergeyKanzhelev commented Jan 3, 2018

@wiktork can it be that extension didn't clean up older binaries after update?

@wiktork

This comment has been minimized.

Show comment
Hide comment
@wiktork

wiktork Jan 3, 2018

@jblackwell-thuzi would you be able to provide the list of files in your D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation32? (Instrumentation64 if this is a 64-bit web app)

wiktork commented Jan 3, 2018

@jblackwell-thuzi would you be able to provide the list of files in your D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Instrumentation32? (Instrumentation64 if this is a 64-bit web app)

@jblackwell-thuzi

This comment has been minimized.

Show comment
Hide comment
@jblackwell-thuzi

jblackwell-thuzi Jan 3, 2018

@wiktork Yes, I can provide both. My app is 64-bit. Thanks let me know if you need anything else.

32-bit

Mode                LastWriteTime         Length Name                          
----                -------------         ------ ----                          
-a----         1/3/2018   4:05 PM          29512 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll   
-a----         1/3/2018   4:05 PM         554304 Microsoft.InstrumentationEngine.Extensions.Base_x86.dll     
-a----         1/3/2018   4:05 PM            486 Microsoft.InstrumentationEngine.Extensions.config           
-a----         1/3/2018   4:05 PM         259392 Microsoft.InstrumentationEngine.ExtensionsHost_x86.dll      
-a----         1/3/2018   4:05 PM        1105648 MicrosoftInstrumentationEngine_x86.dll                      
-a----         1/3/2018   4:05 PM            448 ProductionBreakpoints_x86.config                            
-a----         1/3/2018   4:05 PM         688848 ProductionBreakpoints_x86.dll 
-a----         1/3/2018   4:05 PM         288952 SnapshotHolder_x86.exe 

64-bit

-a----         1/3/2018   4:05 PM          29512 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll   
-a----         1/3/2018   4:05 PM         718656 Microsoft.InstrumentationEngine.Extensions.Base_x64.dll     
-a----         1/3/2018   4:05 PM            486 Microsoft.InstrumentationEngine.Extensions.config           
-a----         1/3/2018   4:05 PM         312120 Microsoft.InstrumentationEngine.ExtensionsHost_x64.dll      
-a----         1/3/2018   4:06 PM        1283832 MicrosoftInstrumentationEngine_x64.dll                      
-a----         1/3/2018   4:05 PM            448 ProductionBreakpoints_x64.config                            
-a----         1/3/2018   4:05 PM         790224 ProductionBreakpoints_x64.dll 
-a----         1/3/2018   4:05 PM         341176 SnapshotHolder_x64.exe

jblackwell-thuzi commented Jan 3, 2018

@wiktork Yes, I can provide both. My app is 64-bit. Thanks let me know if you need anything else.

32-bit

Mode                LastWriteTime         Length Name                          
----                -------------         ------ ----                          
-a----         1/3/2018   4:05 PM          29512 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll   
-a----         1/3/2018   4:05 PM         554304 Microsoft.InstrumentationEngine.Extensions.Base_x86.dll     
-a----         1/3/2018   4:05 PM            486 Microsoft.InstrumentationEngine.Extensions.config           
-a----         1/3/2018   4:05 PM         259392 Microsoft.InstrumentationEngine.ExtensionsHost_x86.dll      
-a----         1/3/2018   4:05 PM        1105648 MicrosoftInstrumentationEngine_x86.dll                      
-a----         1/3/2018   4:05 PM            448 ProductionBreakpoints_x86.config                            
-a----         1/3/2018   4:05 PM         688848 ProductionBreakpoints_x86.dll 
-a----         1/3/2018   4:05 PM         288952 SnapshotHolder_x86.exe 

64-bit

-a----         1/3/2018   4:05 PM          29512 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll   
-a----         1/3/2018   4:05 PM         718656 Microsoft.InstrumentationEngine.Extensions.Base_x64.dll     
-a----         1/3/2018   4:05 PM            486 Microsoft.InstrumentationEngine.Extensions.config           
-a----         1/3/2018   4:05 PM         312120 Microsoft.InstrumentationEngine.ExtensionsHost_x64.dll      
-a----         1/3/2018   4:06 PM        1283832 MicrosoftInstrumentationEngine_x64.dll                      
-a----         1/3/2018   4:05 PM            448 ProductionBreakpoints_x64.config                            
-a----         1/3/2018   4:05 PM         790224 ProductionBreakpoints_x64.dll 
-a----         1/3/2018   4:05 PM         341176 SnapshotHolder_x64.exe
@puneetg1983

This comment has been minimized.

Show comment
Hide comment
@puneetg1983

puneetg1983 Jan 3, 2018

Probably a good idea to run the following command from KUDU -> Debug Console -> Powershell as that will show the file versions easily...

dir *.dll | fl

puneetg1983 commented Jan 3, 2018

Probably a good idea to run the following command from KUDU -> Debug Console -> Powershell as that will show the file versions easily...

dir *.dll | fl

@jblackwell-thuzi

This comment has been minimized.

Show comment
Hide comment
@jblackwell-thuzi

jblackwell-thuzi Jan 3, 2018

@wiktork The versions for the 64-bit.
Thanks @puneetg1983.

Name           : Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
Length         : 29512
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Diagnostics
                 .Instrumentation.Extensions.Base.dll
                 InternalName:     
                 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
                 OriginalFilename: 
                 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
                 FileVersion:      0.0.0.0
                 FileDescription:   
                 Product:          
                 ProductVersion:   0.0.0.0
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         Language Neutral
                 

Name           : Microsoft.InstrumentationEngine.Extensions.Base_x64.dll
Length         : 718656
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Instrumenta
                 tionEngine.Extensions.Base_x64.dll
                 InternalName:     InstrumentationEngine.Extensions.Base
                 OriginalFilename: 
                 FileVersion:      1.0.3.37395
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : Microsoft.InstrumentationEngine.ExtensionsHost_x64.dll
Length         : 312120
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Instrumenta
                 tionEngine.ExtensionsHost_x64.dll
                 InternalName:     InstrumentationEngine.ExtensionsHost
                 OriginalFilename: 
                 FileVersion:      1.0.3.37395
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : MicrosoftInstrumentationEngine_x64.dll
Length         : 1283832
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:06:00 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\MicrosoftInstrumentat
                 ionEngine_x64.dll
                 InternalName:     MicrosoftInstrumentationEngine_x64
                 OriginalFilename: MicrosoftInstrumentationEngine_x64.dll
                 FileVersion:      1.0.3.37395
                 FileDescription:  Microsoft Instrumentation Engine
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : ProductionBreakpoints_x64.dll
Length         : 790224
CreationTime   : 1/3/2018 4:05:36 PM
LastWriteTime  : 1/3/2018 4:05:36 PM
LastAccessTime : 1/3/2018 4:05:36 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\ProductionBreakpoints
                 _x64.dll
                 InternalName:     ProductionBreakpoints_x64
                 OriginalFilename: ProductionBreakpoints_x64.dll
                 FileVersion:      2017121202 
                 79af0959ba3685f5c477036da0eb8842efd0a0d5 
                 ProductionBreakpoints-Release
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   2017121202 
                 79af0959ba3685f5c477036da0eb8842efd0a0d5 
                 ProductionBreakpoints-Release
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)

jblackwell-thuzi commented Jan 3, 2018

@wiktork The versions for the 64-bit.
Thanks @puneetg1983.

Name           : Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
Length         : 29512
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Diagnostics
                 .Instrumentation.Extensions.Base.dll
                 InternalName:     
                 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
                 OriginalFilename: 
                 Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll
                 FileVersion:      0.0.0.0
                 FileDescription:   
                 Product:          
                 ProductVersion:   0.0.0.0
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         Language Neutral
                 

Name           : Microsoft.InstrumentationEngine.Extensions.Base_x64.dll
Length         : 718656
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Instrumenta
                 tionEngine.Extensions.Base_x64.dll
                 InternalName:     InstrumentationEngine.Extensions.Base
                 OriginalFilename: 
                 FileVersion:      1.0.3.37395
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : Microsoft.InstrumentationEngine.ExtensionsHost_x64.dll
Length         : 312120
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:05:59 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\Microsoft.Instrumenta
                 tionEngine.ExtensionsHost_x64.dll
                 InternalName:     InstrumentationEngine.ExtensionsHost
                 OriginalFilename: 
                 FileVersion:      1.0.3.37395
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : MicrosoftInstrumentationEngine_x64.dll
Length         : 1283832
CreationTime   : 1/3/2018 4:06:02 PM
LastWriteTime  : 1/3/2018 4:06:00 PM
LastAccessTime : 1/3/2018 4:06:02 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\MicrosoftInstrumentat
                 ionEngine_x64.dll
                 InternalName:     MicrosoftInstrumentationEngine_x64
                 OriginalFilename: MicrosoftInstrumentationEngine_x64.dll
                 FileVersion:      1.0.3.37395
                 FileDescription:  Microsoft Instrumentation Engine
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   1.0.3.37395
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
                 

Name           : ProductionBreakpoints_x64.dll
Length         : 790224
CreationTime   : 1/3/2018 4:05:36 PM
LastWriteTime  : 1/3/2018 4:05:36 PM
LastAccessTime : 1/3/2018 4:05:36 PM
Mode           : -a----
LinkType       : 
Target         : 
VersionInfo    : File:             D:\home\SiteExtensions\Microsoft.Application
                 Insights.AzureWebSites\Instrumentation64\ProductionBreakpoints
                 _x64.dll
                 InternalName:     ProductionBreakpoints_x64
                 OriginalFilename: ProductionBreakpoints_x64.dll
                 FileVersion:      2017121202 
                 79af0959ba3685f5c477036da0eb8842efd0a0d5 
                 ProductionBreakpoints-Release
                 FileDescription:  
                 Product:          Microsoft® Visual Studio®
                 ProductVersion:   2017121202 
                 79af0959ba3685f5c477036da0eb8842efd0a0d5 
                 ProductionBreakpoints-Release
                 Debug:            False
                 Patched:          False
                 PreRelease:       False
                 PrivateBuild:     False
                 SpecialBuild:     False
                 Language:         English (United States)
@wiktork

This comment has been minimized.

Show comment
Hide comment
@wiktork

wiktork Jan 3, 2018

Thanks for putting this together. Unfortunately these look like the latest bits. I will try repro this issue, but so far I've had no luck.

wiktork commented Jan 3, 2018

Thanks for putting this together. Unfortunately these look like the latest bits. I will try repro this issue, but so far I've had no luck.

@wiktork

This comment has been minimized.

Show comment
Hide comment
@wiktork

wiktork Jan 3, 2018

Also @jblackwell-thuzi @roboffer if you guys are willing to share D:\home\LogFiles\eventlog.xml, we do record some instrumentation failures into this log with the newest version of appinsights. Note there may be unrelated events there too, so please be sure to look over the file first.

wiktork commented Jan 3, 2018

Also @jblackwell-thuzi @roboffer if you guys are willing to share D:\home\LogFiles\eventlog.xml, we do record some instrumentation failures into this log with the newest version of appinsights. Note there may be unrelated events there too, so please be sure to look over the file first.

@jblackwell-thuzi

This comment has been minimized.

Show comment
Hide comment
@jblackwell-thuzi

jblackwell-thuzi Jan 3, 2018

@wiktork Thanks for looking into this. If it helps I was at version 2.00 of the web extension when I encountered the issue. Also it seems kind of a random occurrence as I have been using the mongo driver for a while now in the instance that now has the error. All instances of the driver use cause this now whereas this was not the case in as little as a month ago.

jblackwell-thuzi commented Jan 3, 2018

@wiktork Thanks for looking into this. If it helps I was at version 2.00 of the web extension when I encountered the issue. Also it seems kind of a random occurrence as I have been using the mongo driver for a while now in the instance that now has the error. All instances of the driver use cause this now whereas this was not the case in as little as a month ago.

@roboffer

This comment has been minimized.

Show comment
Hide comment
@roboffer

roboffer Jan 4, 2018

@SergeyKanzhelev It looks like updating the application insights extension has solved our issue, originally I was using the "Restart Site" button in the Site Extensions part of Kudu after making changes and the problem still persisted even after removing application insights entirely.

Killing the w3wp exe from Process Explorer seems to have made it work so it does look like it was v2.0.0 as mentioned above. From reading the extension moves with the slot, so this would explain why switching from staging to live resolved it. I will verify this on our next deployment.

@wiktork I am happy to share that file with you privately

roboffer commented Jan 4, 2018

@SergeyKanzhelev It looks like updating the application insights extension has solved our issue, originally I was using the "Restart Site" button in the Site Extensions part of Kudu after making changes and the problem still persisted even after removing application insights entirely.

Killing the w3wp exe from Process Explorer seems to have made it work so it does look like it was v2.0.0 as mentioned above. From reading the extension moves with the slot, so this would explain why switching from staging to live resolved it. I will verify this on our next deployment.

@wiktork I am happy to share that file with you privately

@roboffer

This comment has been minimized.

Show comment
Hide comment
@roboffer

roboffer Jan 4, 2018

@jblackwell-thuzi Try updating the application insights extension version and then killing the w3wp as I mentioned above, that solved it for us

roboffer commented Jan 4, 2018

@jblackwell-thuzi Try updating the application insights extension version and then killing the w3wp as I mentioned above, that solved it for us

@MattHartz

This comment has been minimized.

Show comment
Hide comment
@MattHartz

MattHartz Feb 2, 2018

Hi everyone,

So to address this issue do we just need to disable or update application insights?

Thanks!

MattHartz commented Feb 2, 2018

Hi everyone,

So to address this issue do we just need to disable or update application insights?

Thanks!

@wiktork

This comment has been minimized.

Show comment
Hide comment
@wiktork

wiktork Feb 2, 2018

@MattHartz Yes, but make sure you restart all your instances to ensure that the updated version has taken effect. As mentioned by @roboffer, you may need to terminate your w3wp.exe processes from Process Explorer.

wiktork commented Feb 2, 2018

@MattHartz Yes, but make sure you restart all your instances to ensure that the updated version has taken effect. As mentioned by @roboffer, you may need to terminate your w3wp.exe processes from Process Explorer.

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