Error: "Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'CommandLineModule' ... System.ArgumentOutOfRangeException: Length cannot be less than zero." When Importing XML File into P6 Professional
(Doc ID 2726807.1)
Last updated on APRIL 07, 2023
Applies to:
Primavera P6 Enterprise Project Portfolio Management Cloud Service - Version 18.8 and laterPrimavera P6 Enterprise Project Portfolio Management - Version 18.8 and later
Information in this document applies to any platform.
Symptoms
When attempting to import XML to P6, the following error occurs.
ERROR
-----------------------
Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'CommandLineModule'.
- The exception message was: One or more errors occurred.
- The Assembly that the module was trying to be loaded from was:Primavera.Mercury.CommandLineModule, Version=20.8.0.36475, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at Primavera.Mercury.Importer.ImportCleaner.AddTrailingNumberToActivityCodeValues(EntitySet`1 activityCodeValues, String activityCodeValueName, Int32 activity_code_type_length, Int32 activityCodeTypeId)
at Primavera.Mercury.Importer.ImportCleaner.CleanupActivityCodeValues(EntitySet`1 activityCodeValues)
at Primavera.Mercury.Importer.ImportCleaner.CleanSourceContext(EntityContext sourceContext, IVenusDataServiceContext targetContext, ILoggerFacade logger, ImportProjectSettings importProjectSettings, Dictionary`2 initialKeyDictionary)
at Primavera.Mercury.CommandLineModule.ExecuteImportExport.d__66.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Primavera.Mercury.CommandLineModule.ExecuteImportExport.d__62.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Primavera.Mercury.CommandLineModule.CommandLineModule.Initialize()
at Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
--- End of inner exception stack trace ---
Failed to load type for module CommandLineModule.
Error was: An exception occurred while initializing module 'CommandLineModule'.
- The exception message was: One or more errors occurred.
- The Assembly that the module was trying to be loaded from was:Primavera.Mercury.CommandLineModule, Version=20.8.0.36475, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |