You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bulk migration tool, select "2. Export subscriptions with migration eligibility".
Issue occurs after "Exporting failed customers" starts.
Expected behavior
Failed customer list is exported to CSV.
Actual behavior
Program crashes with "Unhandled exception. System.ArgumentOutOfRangeException".
Diagnostic logs
Unhandled exception. System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
at System.String.Substring(Int32 startIndex, Int32 length)
at NCEBulkMigrationTool.CsvProvider.ExportCsv[T](IEnumerable`1 data, String fileName) in C:\...\nce-bulk-migration-tool\NCEBulkMigrationTool\CsvProvider.cs:line 24
at NCEBulkMigrationTool.SubscriptionProvider.ExportLegacySubscriptionsAsync() in C:\...\nce-bulk-migration-tool\NCEBulkMigrationTool\SubscriptionProvider.cs:line 79
at Program.<<Main>$>g__RunAsync|0_1(IServiceProvider serviceProvider) in C:\...\nce-bulk-migration-tool\NCEBulkMigrationTool\Program.cs:line 85
at Program.<Main>$(String[] args) in C:\...\nce-bulk-migration-tool\NCEBulkMigrationTool\Program.cs:line 54
at Program.<Main>(String[] args)
Note the failing code in ExportCsv:
int index = fileName.LastIndexOf('/');
var directory = fileName[..index]; // fails here
Directory.CreateDirectory(directory);
And the calling line from SubscriptionProvider.cs:
if (failedCustomersBag.Count > 0)
{
Console.WriteLine("Exporting failed customers");
await csvProvider.ExportCsv(failedCustomersBag, "failedCustomers.csv"); // calling line
Console.WriteLine($"Exported failed customers at {Environment.CurrentDirectory}/failedCustomers.csv");
}
The method is clearly being called with a filename only, so the attempt to locate the training slash returns a -1, causing the substring call to fail. The call should contain a folder path.
Environment
Using the latest posted code for the bulk migration tool.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
In bulk migration tool, select "2. Export subscriptions with migration eligibility".
Issue occurs after "Exporting failed customers" starts.
Expected behavior
Failed customer list is exported to CSV.
Actual behavior
Program crashes with "Unhandled exception. System.ArgumentOutOfRangeException".
Diagnostic logs
Note the failing code in ExportCsv:
And the calling line from SubscriptionProvider.cs:
The method is clearly being called with a filename only, so the attempt to locate the training slash returns a -1, causing the substring call to fail. The call should contain a folder path.
Environment
Using the latest posted code for the bulk migration tool.
The text was updated successfully, but these errors were encountered: