我开始探索 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/