Running the below PowerShell script (i.e. to deploy all SSRS reports for AX) gives an error:
$axdllname = "Microsoft.Dynamics.AX.Framework.Management.dll"
$gacfolder = join-path $env:windir "assembly\GAC_MSIL"
$axdll = Get-ChildItem $gacfolder -Recurse -Name $axdllname
$axdll = join-path $gacfolder $axdll
import-module $axdll
Publish-AXReport -ReportName "*" -RestartReportServer
The error message is:
Publish-AXReport : Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 46, position 8.
At line:1 char:17
+ Publish-AXReport <<<< -ReportName "*" -RestartReportServer
+ CategoryInfo : ParserError: (:) [Publish-AXReport], XmlException
+ FullyQualifiedErrorId : Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 46, position 8.,M
icrosoft.Dynamics.AX.Framework.Management.Reports.PublishReportCommand
Sadly I can't find a copy of the source for Publish-AXReport
, so can't dig deeper into where this exception's coming from.
Question
Does anyone know of a likely cause for this issue, or what steps I could take to uncover the cause?
Update
Instead of running for all reports using *
I tried getting a list of all reports (works fine on its own / shows no reports with names beginning with a space) then piping this to the publish-axreport cmdlet; which now means I can see which report(s) produce that error.
Get-AxReport -ReportName * | Publish-AXReport
It's now clear that there are several reports (though only a small subset of those available) which throw this error when published. One of these is AssetAcquisitionDocumentPL
.
The errors seem to occur only for reports with associated assemblies / always erring for those with; never for those without.
Same issue occurs if running Get-AXReportServerConfiguration | %{Publish-AXAssembly -id $_.ConfigurationId -vsprojectname 'assetAcquisitionDocumentPL.BusinessLogic'}
Running the above with the -verbose
switch shows the error occurs at some point after the assumblies are copied form the temp directory to the SSRS bin directory.