When testing the SSRS build and deploy described in the previous post, I realized that after upgrading SSIS Solutions to Visual Studio 2015 and making changes to the reports they were automatically, in some cases, migrated to version 2016 by the Visual Studio 2015 Designer.
The start of the content of the upgraded rpt file was the following:
<?xml version=”1.0″ encoding=”utf-8″?><Report xmlns=”http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition”/>
The build generated a ispac with some rpt files updgraded to version 2016. During deploy to an infrastrure with SQL Server 2012 occurred the error:
“The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: The report definition has an invalid target namespace ‘http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition‘ which cannot be upgraded.”
After some research I found that targetServerVersion setting choose via project properties and stored in rptproj file were ignored during Build time.
MSBuild has the following behavior, when invoking MSBuild over a project file (rptproj) :
Doesn’t take in account the choose TargetServerVersion.
When MSBuild is invoked over a Solution file (sln) :
The TargetServerVersion property is taken in account and the reports are changed to the selected version as we can see in the above picture.
Conclusion: I have changed the build task to make builds using the unit *.sln file.