0
votes

When inspecting my Azure Application Log, I see an error appearing every 15 minutes or so. When I check my bin folder on the server, I do see all the relevant .dlls installed for Application Insights (eg, Microsoft.ApplicationInsights.dll, Microsoft.AI.*, etc). What am I missing here that might be causing this error?

Here is the exact application log message. Any suggestions would be greatly appreciated.

Application information: Application domain: /LM/W3SVC/1386929123/ROOT-64-130991114402715123 Trust level: Full Application Virtual Path: / Application Path: D:\home\site\wwwroot\ Machine name: RD123D3A70B123

Process information: Process ID: 7928 Process name: w3wp.exe Account name: IIS APPPOOL\satcomroot

Exception information: Exception type: TargetInvocationException Exception message: Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) at System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) at System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) Could not load file or assembly 'Microsoft.ApplicationInsights, Version=1.1.0.1899, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.ApplicationInsights.Extensibility.Web.ApplicationInsightsHttpModule..ctor()

1
Most likely reason is that the version of one of the assembly is not the one that it is looking for. Can you please check the versions of all AI* assemblies in the bin folder? Another question is how you ended up in this situation. Did you onboard your application to Application Insights with Visual Studio and then deployed? Or did you use Application Insights Status Monitor?Alex Bulankou

1 Answers

0
votes

It is failing on System.RuntimeTypeHandle.CreateInstance()

It would make sense to see how are you creating a instance of the object in your code. Maybe there are some arguments that needs to be passed