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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:24:23+00:00 2026-05-22T22:24:23+00:00

In a class library I am working on, I had a class with lots

  • 0

In a class library I am working on, I had a class with lots of properties so I refactored it to be composed of a few smaller, internal classes. However, now I have marked these classes as internal, the code won’t compile when I expose them as public properties on the original class. For example:

public class TheOriginalClass
{
    public MyInternalClass InternalClassProperty { get; set; }
}

// It doesn't make sense to use this by itself
internal class MyInternalClass
{
    public string InterestingProperty { get; set; }
}

Ideally, I would like to encapsulate these helper classes within the assembly as it doesn’t make sense for them to be instantiated anywhere else.

Is there a way to achieve this?

  • 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-22T22:24:24+00:00Added an answer on May 22, 2026 at 10:24 pm

    If you’re exposing the content of the class to the outer world, mark it as public so you’ll later know that the class is a publicly visible one so you’ll be reluctant to change the public interface so often. There is not point in marking it internal if that’s not going to be internal like that.

    If you really want that, use reflection with the calling assembly and with the binding flag BindingFlags.NonPublic while retrieving the classes (and their constructors) in the assembly.

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

Sidebar

Related Questions

The current class library I am working on will have a base class (Field)
I am working on a class library using C#. I have designed 3 main
I'm working in a class library and there are other source projects associated with
I am working in a project that has two main parts: a class library
I'm working on a Javascript class based on the Prototype library. This class needs
We have a class library where we keep a lot of the stuff that
I have a class library with some extension methods written in C# and an
Following the walkthrough at http://msdn.microsoft.com/en-us/library/ee707351(v=VS.91).aspx I have a working Silverlight solution that employs a
I'm attempting to compile a working copy of the MagickNet class library (DLL) using
I have a database and a C# class library which acts as a repository

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.