最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

D365 财务与运营——请求的性能计数器不是自定义计数器,必须初始化为只读/The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. D365

网络文摘 alirazazaidi 3浏览 0评论

在版本 10.0.45 中,在 CHE 环境下,我们发现了厂商发票日记输入中出现的错误:“请求的性能计数器不是自定义计数器,必须初始化为只读”。对一些人来说,抱怨是在尝试获取 PurchTotals 时出现的。

运行下面的PowerShell脚本帮了大忙。

On version 10.0.45, on a CHE environment, we discovered this error “The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly” on vendor invoice journal input. For some, the complain was on when trying to get PurchTotals.

Running the below powershell script helped.

$AOSDirectory = ‘K:\AOSService\PackagesLocalDirectory’
$AOSBinDirectory = $AOSDirectory + ‘\bin’

[Reflection.Assembly]::LoadFrom(“$AOSBinDirectory\Microsoft.Diagnostics.Tracing.EventSource.dll”)

$sharedDLL = ‘Microsoft.Dynamics.AX.Xpp.AxShared.dll’
$subledgerDLL = ‘Microsoft.Dynamics.Subledger.Instrumentation.dll’
$taxDLL = ‘Microsoft.Dynamics.Tax.Instrumentation.dll’
$prodCfgDLL = ‘Microsoft.Dynamics.ProductConfiguration.Instrumentation.dll’
$sourceDocDLL = ‘Microsoft.Dynamics.SourceDocumentation.Instrumentation.dll’

Copy-Item $(Join-Path $AOSDirectory -ChildPath “Subledger\bin” | Join-Path -ChildPath $subledgerDLL) -Destination $AOSBinDirectory
[Reflection.Assembly]::LoadFrom($(Join-Path $AOSBinDirectory -ChildPath $subledgerDLL))
[Microsoft.Dynamics.Subledger.Instrumentation.PerformanceCounterCatalog]::Setup()

Copy-Item $(Join-Path $AOSDirectory -ChildPath “Tax\bin” | Join-Path -ChildPath $taxDLL) -Destination $AOSBinDirectory
[Reflection.Assembly]::LoadFrom($(Join-Path $AOSBinDirectory -ChildPath $taxDLL))
[Microsoft.Dynamics.Tax.Instrumentation.PerformanceCounterCatalog]::Setup()

Copy-Item $(Join-Path $AOSDirectory -ChildPath “SourceDocumentation\bin” | Join-Path -ChildPath $sourceDocDLL) -Destination $AOSBinDirectory
[Reflection.Assembly]::LoadFrom($(Join-Path $AOSBinDirectory -ChildPath $sourceDocDLL))
[Microsoft.Dynamics.SourceDocumentation.Instrumentation.PerformanceCounterCatalog]::Setup()

Copy-Item $(Join-Path $AOSDirectory -ChildPath “ApplicationSuite\bin” | Join-Path -ChildPath $prodCfgDLL) -Destination $AOSBinDirectory
[Reflection.Assembly]::LoadFrom($(Join-Path $AOSBinDirectory -ChildPath $prodCfgDLL))
[Microsoft.Dynamics.ProductConfiguration.Instrumentation.PerformanceCounterCatalog]::Setup()

[Reflection.Assembly]::LoadFrom($(Join-Path $AOSBinDirectory -ChildPath $sharedDLL))
[Microsoft.Dynamics.Ax.Xpp.AxShared.AxPerformanceCounters]::InitializePerformanceCounterCategories()

转载请注明:ww12345678 的部落格 | AX Helper » D365 财务与运营——请求的性能计数器不是自定义计数器,必须初始化为只读/The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. D365

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址