Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Detecting the ObsoleteAttribute/CS0618 when compiling

(0) ShareShare
ReportReport
Posted on by 100

Hi,

Is there any way of detecting the ObsoleteAttribute on members from referenced CLR assemblies used by X++ when compiling?

Similar to what SysObsoleteAttribute does to X++ members.

If I compile the code in C#, the warning “CS0618: '< member >' is obsolete” will be outputted, but I can’t find any trace of this warning when building X++.

Thanks,
DFA

  • Verified answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    If the referenced assemblies are .NET, then it is not possible.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    The answers are about the check of obsolete X++ elements.

    I don't think that X++ compiler has a feature to warn about obsolete objects in referenced .NET assemblies.

  • huijij Profile Picture
    huijij 19,811 on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    The warning messages in x++ are also different.

    1200.png4745.Capture.PNG

  • huijij Profile Picture
    huijij 19,811 on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    You can run best-practice checks from the command line. Please check the MS document:

    learn.microsoft.com/.../author-best-practice-rules

  • DFA Profile Picture
    DFA 100 on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    Hi Judy,

    I have tried that without success on a 10.0.29 and 10.0.33.

  • huijij Profile Picture
    huijij 19,811 on at
    RE: Detecting the ObsoleteAttribute/CS0618 when compiling

    Hi DFA,

    Please check if you have tried build the model with Run Best Practice Checks. Dynamics 365 menu > click Build models > Options.

    456428.png

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans