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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

CultureInfo.InvariantCulture does not exist

(2) ShareShare
ReportReport
Posted on by 4
Hello all, I'm trying to test some code in X++ to see if we need to go from declaring a de-de CultureInfo to the InvariantCulture in order to preserve a date's integrity.
The line I'm using is
System.Globalization.CultureInfo provider = System.Globalization.CultureInfo.InvariantCulture;
But I'm getting 4 error messages saying
The qualifier 'System.Globalization.CultureInfo' is not valid for field 'InvariantCulture'.
The qualifier 'System.Globalization' is not valid for field 'CultureInfo'.
The qualifier 'System' is not valid for field 'Globalization'.
'System' is not declared.
 
Which is strange since there's no issues with having
System.Globalization.CultureInfo provider;
by itself.

I've created a runnable class where this is the only code inside the main method so I don't beleive it's anything blocking it. It works in my C# project but not in the X++ project so I think it has something to do with it being X++ specifically but I can't find anything saying why I can use CultureInfo but not the InvariantCulture part of it.
 
I've tried on Visual Studios 2022, my project is in .Net Framework 4.7.2 and that framework says it's still being supported.
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at
    InvariantCulture is a static property, therefore the correct syntax in X++ is System.Globalization.CultureInfo::InvariantCulture instead of System.Globalization.CultureInfo.InvariantCulture.
     
    Moved from Integration, Dataverse, and general topics forum to Finance | Project Operations, Human Resources, AX, GP, SL forum.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans