Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:23:19+00:00 2026-06-18T16:23:19+00:00

When I have this c++ cli code: #pragma managed ref class mcSessions: ConcurrentDictionary <String

  • 0

When I have this c++ cli code:

#pragma managed
ref class mcSessions: ConcurrentDictionary <String ^, mcSession^> 
{  //<---- warning here
private:
   static mcSessions ^g_Sessions;
       TimeSpan MaxIdleTime;
   mcSessions (TimeSpan newMaxIdleTime);
public:
    static void Initialize (long MaxIdleMinutes);
        static void Shutdown ();
        static void CreateSession (String ^&SessionId);
        static void RunInSession (String ^SessionId, String ^Command);
        static void RemoveSession (String ^SessionId);
};

I get a warning C4538 on the first {. Does anybody has any clue why this happens and what it warns for, or is this also a compiler bug as it is for the situation in this question: Seemingly inappropriate compilation warning with C++/CLI

Although I see they are somewhat related, I do not have a Group object but a ConcurrentDictionary. I am using Visual Studio 2010 targeting the .NET 4.0 framework and compiling with the /clr compiler flag on.

The exact error message is:

1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=System::Collections::Concurrent::ConcurrentDictionary::Node ^,
1>              dimension=1
1>          ]
1>          This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=int,
1>              dimension=1
1>          ]
1>          This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>::Node ^,
1>              dimension=1
1>          ]
1>          d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25) : see reference to class generic instantiation 'System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>' being compiled
1>          d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25) : see reference to class generic instantiation 'System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>' being compiled
1>          with
1>          [
1>              TKey=System::String ^,
1>              TValue=IamPowershell::mcSession ^
1>          ]
1>          This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary::Node ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=int,
1>              dimension=1
1>          ]
1>          This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary::Node ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=System::Collections::Concurrent::ConcurrentDictionary<System::String ^,mcSession ^>::Node ^,
1>              dimension=1
1>          ]
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1>          with
1>          [
1>              Type=int,
1>              dimension=1
1>          ]
1>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:23:21+00:00Added an answer on June 18, 2026 at 4:23 pm

    As @HansPassant noted in the comment on the question he is right. The members are indeed volatile (stupid me, could have checked that :S) Anyway that should be the answer.
    Thankx I consider it solved now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well I have this code in my Managed C++/Cli in Visual Studio 2008, I
I have the following code: <td class=select-cli-numbers><div class=explanationText style=cursor:pointer;>Click here to select numbers</div></td> which
I have this code in C++/CLI project: CSafePtr<IEngine> engine; HMODULE libraryHandle; libraryHandle = LoadLibraryEx(FREngine.dll,
I have a C++/CLI DLL that uses some managed code (written in C#). I
In some C++/CLI code I have a native class which has a factory method
So here is a more java-esq approach (I think)...I have this code in Ruby
In my C++\CLI i have this piece of code: array<Byte>^ out_buf = gcnew array<Byte>(stream_size);
The following code: ref class A { private: int% referenceToAnInt; }; produces the following
I have a cli application that doesn't like the usage of wildcards. In this
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.