Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.82 KB

File metadata and controls

36 lines (27 loc) · 1.82 KB

PX1057

This document describes the PX1057 diagnostic.

Summary

Code Short Description Type Code Fix
PX1057 A PXGraph instance cannot be initialized while another PXGraph instance is being initialized. Error Unavailable

Diagnostic Description

A PXGraph instance cannot be initialized while another PXGraph instance is being initialized. The following code elements are considered to be a part of the graph initialization:

  • The PXGraph and PXGraphExtension constructors
  • The Initialize method overridden in PXGraphExtension
  • The Initialize method of PXGraph that implements the PX.Data.DependencyInjection.IGraphWithInitialization interface
  • The Configure method overridden in PXGraph and PXGraphExtension

To fix the issue, you should remove the initialization of the PXGraph instance from the initialization logic and rework the related business logic.

This diagnostic is displayed as a warning if the Enable additional diagnostics for ISV Solution Certification option (in Tools > Options > Acuminator > Code Analysis) is set to False.

Example of Incorrect Code

public class DocCustomerExtensionMaint : PXGraph<DocCustomerExtensionMaint>
{
	public DocCustomerExtensionMaint()
	{
		DocConnMaint maint = PXGraph.CreateInstance<DocConnMaint>(); // The PX1057 error is displayed for this line.
	}
}

Related Articles