tobania / VSTS.Extension.SqlReportingServices

VSTS Extension for uploading SSRS Reports
MIT License
14 stars 20 forks source link

Adding functionality to ignore SQL Server version check #33

Open NullReferenceError opened 6 years ago

NullReferenceError commented 6 years ago

Basically I just catch the exception and throw it out if the flag is enabled. Works for my use case, there might be a better way to do it. Let me know if there are any changes you want.

anton-kirschhock commented 6 years ago

The issue I have is that you've hardcoded the exception string. I suspect that this will not work on, for example, on dutch servers,.... Also I find it odd that the api interface is throwing errors but the SSRS UI not. It is, to me, more an infra issue

NullReferenceError commented 6 years ago

I agree that catching that specific error message isn't the best method, but we don't want to throw out all SOAP Exceptions (That error message comes from the System.Web.Services.Protocols.SoapException namespace) maybe I can find a more specific code in the exception to handle.

2018-03-21T21:51:44.7466933Z ##[error]Microsoft.PowerShell.Commands.WriteErrorException: System.Web.Services.Protocols.SoapException: 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: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1. 2018-03-21T21:51:44.7466933Z at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, ItemType ItemType, CatalogItem& ItemInfo, Warning[]& Warnings) 2018-03-21T21:51:44.7466933Z at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateCatalogItem(String ItemType, String Name, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, CatalogItem& ItemInfo, Warning[]& Warnings) 2018-03-21T21:51:44.7476933Z at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateCatalogItem(String ItemType, String Name, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, CatalogItem& ItemInfo, Warning[]& Warnings)

ALSO! I did find that this specific message happens when other file types that are not .rdl or .rds make it into the /bin/ folder of a report build from visual studio, and the extension tries to upload the entire directory if the filetype is not specified. Maybe a filter can just be applied for those filetypes as the input to prevent this? I do see that the extension supports wildcards, so checking that user's use "/.rdl" instead of "/" can typically prevent the issue.