AzureDiagnostics 因 System.ArgumentException 崩溃:已添加具有相同密钥的项目
AzureDiagnostics crashing with System.ArgumentException: An item with the same key has already been added
在最近部署的云服务中,我的应用程序事件日志中出现了很多错误。大概是我们在 Azure Diagnostics 中错误配置了某些东西,而 Azure Diagnostics 无法妥善处理它。但是具体配置错误的是什么?
我每 5 分钟收到一次:
Source=AzureDiagnostics 的第一个错误
System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at ApplicationInsightsExtension.WindowsEventLogPublisher..ctor(ILogger logger, ITelemetryClient client, String logTablesPath, IEnumerable`1 dataSources, ILocalTableReader tableReader, Dictionary`2 configProperties) in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\Publishers\WindowsEventLogPublisher.cs:line 59
at ApplicationInsightsExtension.WAD2AIExtension.GetPublishersBasedOnConfig() in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\WAD2AIExtension.cs:line 114
at ApplicationInsightsExtension.Program.Main(String[] args) in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\Program.cs:line 43
然后错误源=.NET 运行时
Application: ApplicationInsightsExtension.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at ApplicationInsightsExtension.Program.Main(System.String[])
然后出现源错误=应用程序错误
Faulting application name: ApplicationInsightsExtension.exe, version: 33.3.11.0, time stamp: 0x57224d6d
Faulting module name: KERNELBASE.dll, version: 6.3.9600.18202, time stamp: 0x569e7eb1
Exception code: 0xe0434352
Fault offset: 0x0000000000008a5c
Faulting process id: 0x1504
Faulting application start time: 0x01d1bcb0c4a62a77
Faulting application path: C:\Resources\directory3a5550e74e40448af87aa6c4d6183a.OUR.APP.NAME.DiagnosticStore\WAD0106\Package\Ext\ApplicationInsightsExtension\Commit\ApplicationInsightsExtension.exe
Faulting module path: D:\Windows\system32\KERNELBASE.dll
Report Id: 02a628df-28a4-11e6-80c2-00155dc05ef6
Faulting package full name:
Faulting package-relative application ID:
看起来问题出在我的诊断配置 > Windows 事件日志中。我同时勾选了 System!*
和 System![System[(Level = 1 or Level=2)]]
。哦。
我仍然会遇到类似这样的其他错误,但似乎并不重要。
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Azure.Plugins.Diagnostics.dll.RoleInformation.get_IsWorkerRole()
在最近部署的云服务中,我的应用程序事件日志中出现了很多错误。大概是我们在 Azure Diagnostics 中错误配置了某些东西,而 Azure Diagnostics 无法妥善处理它。但是具体配置错误的是什么?
我每 5 分钟收到一次:
Source=AzureDiagnostics 的第一个错误
System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at ApplicationInsightsExtension.WindowsEventLogPublisher..ctor(ILogger logger, ITelemetryClient client, String logTablesPath, IEnumerable`1 dataSources, ILocalTableReader tableReader, Dictionary`2 configProperties) in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\Publishers\WindowsEventLogPublisher.cs:line 59
at ApplicationInsightsExtension.WAD2AIExtension.GetPublishersBasedOnConfig() in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\WAD2AIExtension.cs:line 114
at ApplicationInsightsExtension.Program.Main(String[] args) in x:\bt5234\repo\src\agent\extensions\AppInsightsExtension\Program.cs:line 43
然后错误源=.NET 运行时
Application: ApplicationInsightsExtension.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at ApplicationInsightsExtension.Program.Main(System.String[])
然后出现源错误=应用程序错误
Faulting application name: ApplicationInsightsExtension.exe, version: 33.3.11.0, time stamp: 0x57224d6d
Faulting module name: KERNELBASE.dll, version: 6.3.9600.18202, time stamp: 0x569e7eb1
Exception code: 0xe0434352
Fault offset: 0x0000000000008a5c
Faulting process id: 0x1504
Faulting application start time: 0x01d1bcb0c4a62a77
Faulting application path: C:\Resources\directory3a5550e74e40448af87aa6c4d6183a.OUR.APP.NAME.DiagnosticStore\WAD0106\Package\Ext\ApplicationInsightsExtension\Commit\ApplicationInsightsExtension.exe
Faulting module path: D:\Windows\system32\KERNELBASE.dll
Report Id: 02a628df-28a4-11e6-80c2-00155dc05ef6
Faulting package full name:
Faulting package-relative application ID:
看起来问题出在我的诊断配置 > Windows 事件日志中。我同时勾选了 System!*
和 System![System[(Level = 1 or Level=2)]]
。哦。
我仍然会遇到类似这样的其他错误,但似乎并不重要。
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Azure.Plugins.Diagnostics.dll.RoleInformation.get_IsWorkerRole()