Solved

Debug an internal class

  • 10 February 2023
  • 3 replies
  • 164 views

Userlevel 2
Badge

How can we debug an internal class ?? I am trying to debug ActivityHelper.cs from the 
App_Data\CodeRepository\PX.Objects\CR folder.

I am able to debug other files such as ContactMaint from the same folder. 

icon

Best answer by Naveen Boga 13 February 2023, 02:24

View original

3 replies

Userlevel 7
Badge +11

Hi @param2022 

Please refer the below link,

Debug Acumatica Code - Acumatica Developers Blog .....

Userlevel 2
Badge

@jinin I already followed this article and was able to debug ContactMaint.cs but I am facing issue with this particular file which declares an attribute.

Userlevel 7
Badge +17

Hi @param2022 

I got the below information from other sources.

 

Yes, you can debug another assembly's internal class in C#. However, you need to make sure you have the necessary permissions and access to the assembly's code.

By default, internal classes are only accessible within the same assembly, so you would need to change the accessibility level to the public or make use of the "InternalsVisibleTo" attribute in the AssemblyInfo.cs file to allow access to the internal class (Helper Class) from another assembly. I’m NOT sure, whether Acumatica will allow us to change this.

Once you have the necessary access, you can use a debugger to step through the code and inspect the internal class as you would with any other class. Just keep in mind that changing the accessibility level of internal classes can impact the stability and security of the code, so use caution and make sure you understand the implications of making these changes.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved