web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

(4) ShareShare
ReportReport
Posted on by 911
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?
 
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,792 Super User 2026 Season 1 on at
    The error CS0102 indicates a duplicate declaration of ProcessDateRange_TextConst_βconst in Codeunit50024. Check for multiple declarations of the text constant, remove any duplicates, and clear cached compilation errors from C:\ProgramData\Microsoft\Microsoft Dynamics NAV\260\Server\MicrosoftDynamicsNavServer$MS\apps\compilationerrors. Restart the BC server, recompile, and republish. If the issue persists, it may be a bug in the Preview version—test on a stable release 
     
  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at
    There are some changes in version 26, previously those are warnings but now they are Errors, if you have the variable name in Table and Page it throws an error, that is just an example. Try to point your app to version 26 and build it, it should show you all the errors in vscode which you need to fix before publishing them.
     
  • Suggested answer
    YUN ZHU Profile Picture
    101,948 Super User 2026 Season 1 on at
    It should be a problem with the AL Language version. Please try again after updating to the released version.
     
    Thanks.
    ZHU
  • Nick Webb Profile Picture
    911 on at
    Thanks all for responses.
     
    1. Re: Khushbu Rajvi's point: There are no multiple declarations of any text constants in the code.
    2. Re: Suresh Kulla's point: I pointed the app to version 26 and built it successfully. A few warnings, but no errors.
    3. Re: YUN ZHU's point: I now have version 15.0.1410565 installed (see below). I'm not getting the CS0102 error any more but 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. I have nothing to go on?
     
    cuDRP: Codeunit DateRangeProcessor;
     
    txtEditedDesc := cuDRP.ProcessDateRange(txtDesc, txtRecurrence);
     
     
    Here are the compiler warnings:
     
    c:\Source\VSCode\AL_R&D\RecurringInvoices_20_PreRelease\Cod50023PurchInvReplicator.al(87,26): warning AL0432: Codeunit 'NoSeriesManagement' is marked for removal. Reason: Please use the "No. Series" and "No. Series - Batch" codeunits instead. Tag: 24.0.
    c:\Source\VSCode\AL_R&D\RecurringInvoices_20_PreRelease\Cod50021InvoiceReplicator.al(426,26): warning AL0432: Codeunit 'NoSeriesManagement' is marked for removal. Reason: Please use the "No. Series" and "No. Series - Batch" codeunits instead. Tag: 24.0.
    c:\Source\VSCode\AL_R&D\RecurringInvoices_20_PreRelease\Qry50021_APIPostedSalesInvoice.al(160,41): warning AL0432: Field 'Package Tracking No.' is marked for removal. Reason: Field length will be increased to 50.. Tag: 24.0.
    c:\Source\VSCode\AL_R&D\RecurringInvoices_20_PreRelease\Cod50023PurchInvReplicator.al(91,31): warning AL0432: Method 'GetNextNo' is marked for removal. Reason: Please use method GetNextNo(Code[20]; Date) or PeekNextNo(Code[20]; UsageDate) in the codeunit "No. Series" or "No. Series - Batch" instead. GetNextNo(Code[20]; Date; Boolean) does not have the same behavior. Make sure to use the correct parameters.. Tag: 24.0.
    c:\Source\VSCode\AL_R&D\RecurringInvoices_20_PreRelease\Cod50021InvoiceReplicator.al(430,31): warning AL0432: Method 'GetNextNo' is marked for removal. Reason: Please use method GetNextNo(Code[20]; Date) or PeekNextNo(Code[20]; UsageDate) in the codeunit "No. Series" or "No. Series - Batch" instead. GetNextNo(Code[20]; Date; Boolean) does not have the same behavior. Make sure to use the correct parameters.. Tag: 24.0.

     
  • Nick Webb Profile Picture
    911 on at
    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.
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,561 Super User 2026 Season 1 on at
    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.
  • Suggested answer
    YUN ZHU Profile Picture
    101,948 Super User 2026 Season 1 on at
    Hi, Business Central 2025 wave 1 (BC26) is generally available.
     
    Please try again in the released version.
     
    Hope this helps.
    Thanks.
    ZHU
  • Nick Webb Profile Picture
    911 on at
    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
    Khushbu Rajvi. Profile Picture
    22,792 Super User 2026 Season 1 on at
  • Nick Webb Profile Picture
    911 on at
    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?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,250 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,799 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,390

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans