1
Vote

Specifying empty TargetPath attribute causes index out of range exception.

description

If the TargetFolder at the following location in the RSBuild.config file is specified as empty:
  <DataSources>
    <DataSource
        TargetFolder=""
      />
  </DataSources>
then I get an index out of bounds operation from the string stuff in PathUtil.cs:
[Settings]: Loading RSBuild settings from 'c:\Users\binki\AeroFS\repos_realwin\Main\Code\Database\Report Project\RSBuild.config'
[Settings]: Index was outside the bounds of the array.

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at RSBuild.PathUtil.FormatPath(String input) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Utilities\PathUtil.cs:line 33
   at RSBuild.PathUtil.GetRelativePath(String source, String target) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Utilities\PathUtil.cs:line 45
   at RSBuild.Entities.Report.ReportDataSource.SetDataSourceReference(DataSource dataSource) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Entities\Report.cs:line 213
   at RSBuild.Entities.ReportGroup..ctor(String name, String targetFolder, DataSource dataSource, ReportServerInfo reportServer, IEnumerable`1 reports) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Entities\ReportGroup.cs:line 90
   at RSBuild.Settings.ReadSettings(XmlDocument d) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Settings.cs:line 297
   at RSBuild.Settings..ctor(String settingsFilePath) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Settings.cs:line 80
   at RSBuild.Settings.Load(String settingsFilePath) in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Settings.cs:line 48
   at RSBuild.Dispatcher.Run() in c:\Users\binki\AeroFS\repos_realwin\rsbuild\trunk\src\RSBuild.Core\Dispatcher.cs:line 28
   at RSBuild.AppEntry.Main(String[] args)
Signal 79
Replacing the empty TargetFolder with some value, like TargetFolder="Foods", skirts around the issue. But this bug prevents data sources from being written directly to the root of the ReportServer.

I am using r99885 trunk.

file attachments

comments