Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

26.0.30643.32477 (Preview) - error CS0102

(3) ShareShare
ReportReport
Posted on by 809
I'm testing one of my extensions on a Sandbox running version: 26.0.30643.32477 (Preview) and when I select 'Publish without debugging' the lines below are displayed in the Console of the code editor:
 
[2025-04-02 15:55:28.41] Error: C# compilation has failed for the application object CodeUnit_50024.
The failing c# file name is E2304FBC7C4AFA5538E1C81DFB4C48646798BDFD6531E806B1CD1E962A28035F.cs. You can find this file with the associated AL file saved in the C:\ProgramData\Microsoft\Microsoft Dynamics NAV\260\Server\MicrosoftDynamicsNavServer$MS\apps\compilationerrors folder.
Detailed compilation error: C:\ProgramData\Microsoft\Microsoft Dynamics NAV\260\Server\MicrosoftDynamicsNavServer$MS\apps\metadata\3\E2304FBC7C4AFA5538E1C81DFB4C48646798BDFD6531E806B1CD1E962A28035F.cs(561,40): error CS0102: The type 'Codeunit50024' already contains a definition for 'ProcessDateRange_TextConst_βconst'
C:\ProgramData\Microsoft\Microsoft Dynamics NAV\260\Server\MicrosoftDynamicsNavServer$MS\apps\metadata\3\E2304FBC7C4AFA5538E1C81DFB4C48646798BDFD6531E806B1CD1E962A28035F.cs(562,40): error CS0102: The type 'Codeunit50024' already contains a definition for 'ProcessDateRange_TextConst_βconst'
 
When I test the process and it gets to the line where it calls the DateRangeProcessor codeunit (mentioned above), I get a 'Something went wrong' web-page.
 
What's causing this?
 
  • Nick Webb Profile Picture
    809 on at
    26.0.30643.32477 (Preview) - error CS0102
    As previously stated further down this trail:
     
    It gets to the line below where it calls a procedure in a codeunit in the extension (DateRangeProcessor) and aborts as it calls the procedure with no error reported in the code-editor. It doesn't even get to the first line in the procedure. In the browser: 'Something went wrong. An error has occurred'. No actual error is reported.
     
    cuDRP: Codeunit DateRangeProcessor;
     
    txtEditedDesc := cuDRP.ProcessDateRange(txtDesc, txtRecurrence);
     
    No friendly error message like: 'Invalid TextConst' or other?
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,504 Super User 2025 Season 1 on at
    26.0.30643.32477 (Preview) - error CS0102
    Have you tried putting a debugger and stepping through the code to see exactly where it fails?
  • Verified answer
    Nick Webb Profile Picture
    809 on at
    26.0.30643.32477 (Preview) - error CS0102
    I've nailed it, but an error message would've been nice? I had 3 TextConst's at the top of the offending procedure. Turns out, I'm not even using them so I commented them out and all is now working. Version 25 and before did not object to these 3 lines but V26 crashes. That's a day of my life I won't get back.
     
        procedure ProcessDateRange(txtDesc: Text; txtRecurrence: Text): Text
        var
            // PLUSONEMONTH: TextConst ENU = '+1M';
            // PLUSONEQUARTER: TextConst ENU = '+1Q';
            // PLUSONEYEAR: TextConst ENU = '+1Y';
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,504 Super User 2025 Season 1 on at
    26.0.30643.32477 (Preview) - error CS0102
    No nothing is wrong. So are you facing same issue in this new sandbox?
  • Nick Webb Profile Picture
    809 on at
    26.0.30643.32477 (Preview) - error CS0102
    When I created the Sandbox in the Admin Centre I choose as below:
     
     
    The resultant Sandbox shows:
    and in the BC GUI it shows:
     
    Is this wrong?
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,504 Super User 2025 Season 1 on at
    26.0.30643.32477 (Preview) - error CS0102
  • Nick Webb Profile Picture
    809 on at
    26.0.30643.32477 (Preview) - error CS0102
    I now have a Sandbox running the release version 26:
    ... and it hasn't changed a thing. It still crashes out as previously described. Once again, I have no error to guide me. Only: 'Something went wrong. An error has occurred'. Where can I look for errors. I had a look in Event viewer. Nothing there of interest.
    Other extensions are working fine.

     
  • Suggested answer
    YUN ZHU Profile Picture
    85,674 Super User 2025 Season 1 on at
    26.0.30643.32477 (Preview) - error CS0102
    Hi, Business Central 2025 wave 1 (BC26) is generally available.
     
    Please try again in the released version.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Ramesh Kumar Profile Picture
    5,458 on at
    26.0.30643.32477 (Preview) - error CS0102
    Hi Nick,
     
    As this is the Preview version, it's likely this issue will occur. I suggest logging it on Yammer with BC team.
     
    Thanks
    Ramesh
     
    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.
  • Nick Webb Profile Picture
    809 on at
    26.0.30643.32477 (Preview) - error CS0102
    Just to add, I've dealt with all the warnings and the extension is now compiling with no warnings or errors, but it hasn't changed a thing. It still crashes out as previously described.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans