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 4330766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:00:31+00:00 2026-05-21T10:00:31+00:00

I need to declare a member that is both protected AND internal. However, to

  • 0

I need to declare a member that is both protected AND internal. However, to my complete bafflement, I just discovered the hard way that “protected internal” actually means protected OR internal. Is there any access modifier that means protected AND internal?

  • 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-05-21T10:00:32+00:00Added an answer on May 21, 2026 at 10:00 am

    Though the CLR supports it, in C# there is no way to force a member to be protected AND internal.

    Both C# and VB.NET combine access modifiers using a union, rather than intersection.

    There is a workaround for this if you absolutely have to have it. It’s not clean, but it works. You can create a helper class with an internal property on it, and then add a protected property of that inner class type to your class. The internal property of the protected property will only be accessible on a subclass within the owning assembly.

    Example follows. I’ve used a generic on the chance that you might want multiple protected internal properties of different types. The generic will allow you to use the one inner class regardless of the desired property type.

    public class AccessHelper<T>
    {
        internal T Value { get; set; }
    }
    
    public class AClass
    {
        public AClass()
        {
            InternalProperty.Value = "Can't get or set this unless you're a derived class inside this assembly.";
        }
    
        protected AccessHelper<String> InternalProperty
        {
            get;
            set;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to declare the query variable outside the switch statement that way I
I need to access some members marked internal that are declared in a third
I need to declare an enum variable as a class member and need to
In C# do properties need to reference private member variables, or can I just
I need to declare an array of pointers to functions like so: extern void
I need to declare 3d array variable but can't. int[][][] ary = new int[5][2][];
I need to declare square matrices in C# WinForms with more than 20000 items
I think in this case there is no need to declare a public constructor
I have a vector declared as a global variable that I need to be
Need a function that takes a character as a parameter and returns true if

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.