vb.net - Application Insights 在加载时因 System.Reflection.TargetInvocationException 失败 - WP 8.1

标签 vb.net windows-phone-8.1 azure-application-insights

我开始探索 Application Insights 并尝试将其添加到我的 Windows Phone 8.1 应用程序中。在尝试执行项目时,在 Public Sub New() 内加载时抛出异常。在 App.xaml.vb 中。发生错误的那一行是

TelemetryClient = new TelemetryClient()

抛出的异常是

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll

An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.ni.dll but was not handled in user code

Additional information: Exception has been thrown by the target of an invocation.



内部异常详情:

{System.InvalidOperationException: Type 'Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights, Version=0.16.1.418, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not implement the required interface

Microsoft.ApplicationInsights.Extensibility.IContextInitializer. at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.CreateInstance(Type interfaceType, String typeName) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstance(XElement definition, Type expectedType, Object instance) at Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstances[T](XElement definition, ICollection`1 instances)}



我遵循了概述的步骤 in the Azure documentation .我可能做错了什么?

最佳答案

您是在 Windows 运行时之上还是在 Silverlight 之上使用 Windows Phone 应用程序?

如果您从 ApplicationInsights.config 中删除以下行,您的应用程序是否成功启动?

    <Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>

关于vb.net - Application Insights 在加载时因 System.Reflection.TargetInvocationException 失败 - WP 8.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30020558/

相关文章:

.net - 图片框面板闪烁

c# - 为什么其他不可变类型没有 StringBuilder 的等价物?

c# - 带有 Windows 手机的 Xamarin 表单 - MediaElement 无法正常工作

c# - 在 Windows Phone 8.1 中如何知道哪一页是我的最后一页

azure - 对 Azure Function App 实现 Application Insight

azure - 应用程序洞察中间件 - 跟踪 SQL 参数

c# - 将此代码从 C# 转换为 VB.NET

cordova - PhoneGap 应用程序在 WP8.1 上崩溃

azure - 如何在 Azure Application Insights 中查看或筛选记录器名称的跟踪?

vb.net - 如何在 Word 文档中插入 Image 对象作为图片