Not Able to Fetch Data with Dynamics 365 Report Authoring Extension during SSRS Development

When I first set up the report project in Visual Studio 2015 with Dynamics 365 Report Authoring Extension 9.0 to develop the SSRS report for Dynamics 365, I got the following error while trying to fetch the data using FetchXML and I could not find any solution by having a quick web search. After contacting Microsoft Support, I was given the resolution below and I hope it helps for those who encounter the same issue

SYMPTOM

When you click "Refresh Fields" in the DataSet editor or when you try to run a query in the query designer, you receive the following error message:

Cannot load Counter Name data because an invalid index '' was read from the registry.

RESOLUTION


  1. Go to Start, type "cmd".
  2. Right-click on cmd.exe and choose ‘Run as administrator’. 
  3. Type "lodctr /r" and press enter.
    • Run the command in the following folder for 64-bit OS "C:\windows\SysWOW64> lodctr /r")
  4. You will then get the message ‘Info: Successfully rebuilt performance counter setting from system backup store’.
    • After that, retry the data fetch in Visual Studio and if the problem is resolved, Steps 5-6 are not necessary
  5. Check if there are providers that are disabled, write "lodctr /q" and press enter
  6. You will then get a long list of providers, make sure that the [CRM Client] is Enabled. If not, write "lodctr /e:CRM Client" and press enter. And try connecting to database again. 

MORE INFORMATION

The full error stack trace can be found below

===================================

An error occurred while executing the query.
An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365 Administrator. Finally, you can contact Microsoft Support. (Microsoft SQL Server Report Designer)

===================================

An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics 365 Community for solutions or contact your organization's Microsoft Dynamics 365 Administrator. Finally, you can contact Microsoft Support. (mscorlib)

------------------------------
Program Location:


Server stack trace: 
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.SdkMetadataProvider.GetEntity(String name)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.MetadataHelper.GetEntity(String name)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.EntityExpression.get_EntityMetadata()
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.AttributeExpression.get_AttributeMetadata()
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.PropertyExpressionFactory.GetAttributeTypeDisplayName(AttributeExpression attribute)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.PropertyExpressionFactory.GetProperties(AttributeExpression attribute)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.FetchProcessor.InitializeEntityFields(XmlNode entityNode, EntityExpression parentEntityExpression, IList`1 reportFieldNames)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.FetchProcessor.InitializeFields(XmlDocument fetchDocument)
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.FetchProcessor..ctor(String fetchXml, ICrmDataParameterCollection parameters, IMetadataHelper metadataHelper)
   at Microsoft.Crm.Reporting.DataExtension.Client.Fetch.FetchDataExtensionCommand.<ExecuteReader>b__1_0()
   at Microsoft.Crm.Reporting.DataExtension.Common.ExceptionManager.HandleUnsafeException[TResult](Func`1 body)
   at Microsoft.Crm.Reporting.DataExtension.Client.Fetch.FetchDataExtensionCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Crm.Reporting.DataExtensionShim.Common.SrsExtCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.ReportingServices.QueryDesigners.MultiThreadedQueryResultsHelper.AsyncExecuteReader(IDbCommand command, CommandBehavior behaviour)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at Microsoft.ReportingServices.QueryDesigners.MultiThreadedQueryResultsHelper.ExecuteReaderHandler.EndInvoke(IAsyncResult result)
   at Microsoft.ReportingServices.QueryDesigners.MultiThreadedQueryResultsHelper.<>c__DisplayClass4.<ExecuteActiveQueryCallback>b__3()
   at Microsoft.ReportingServices.QueryDesigners.QueryResultsGrid.EndExecuteReaderInUiThread(GetDataReaderHandler getDataReaderCallback)

===================================

The type initializer for 'Microsoft.Crm.LocatorService' threw an exception.

------------------------------
Program Location:

   at Microsoft.Crm.Core.DataServices.Configuration.ConfigProviders.LocatorServiceSkuInfoProvider.GetSku()
   at Microsoft.Crm.Core.Telemetry.TelemetryFacade.CreateInstance()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at Microsoft.Crm.Reporting.DataExtension.Common.Fetch.Utility.SdkMetadataProvider.GetEntity(String name)

===================================

Cannot load Counter Name data because an invalid index '' was read from the registry.

------------------------------
Program Location:

   at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
   at System.Diagnostics.PerformanceCounterLib.get_NameTable()
   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
   at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
   at Microsoft.Crm.LocatorCache.CreatePerformanceCounters()
   at Microsoft.Crm.LocatorCache..ctor(LocatorServiceContext locatorServiceContext)
   at Microsoft.Crm.RemoteLocatorService..ctor()
   at Microsoft.Crm.LocatorService..ctor(ILocatorService service)
   at Microsoft.Crm.LocatorService..cctor()  


Comments

Popular Posts