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

  • Home
  • SEARCH
  • 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 3599264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:20:47+00:00 2026-05-18T20:20:47+00:00

In a namespace, is it possible to provide an alias for a class? And

  • 0

In a namespace, is it possible to provide an alias for a class? And if not, why not?

By example, if I had several libraries of things that were derived from a contained, but named base class, but wanted to alias that as “BaseClass”, while retaining its actual class name (i.e. “HtmlControl”).

Then consumers could always come along and extend from HtmlControls.BaseClass, without having to figure out which class it really comes from.

  • 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-18T20:20:48+00:00Added an answer on May 18, 2026 at 8:20 pm

    There really isn’t an ideal way to do this in C#/.NET. What you can do is have a public BaseClass that inherits from an internal class. You can change this inheritance internally without breaking your consumers as long as the interface to the class remains intact.

    public class PublicBaseClass : SomeInternalClass {
    
    }
    

    Consumers inherit from PublicBaseClass, and as long as you are careful, you can change what SomeInternalClass is as you wish.

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

Sidebar

Related Questions

In a namespace, is it possible to provide an alias for a class? And
Suppose I've got the following program: namespace ReflectionTest { public class Example { private
In C++ is it possible to use another base class to provide the implementation
Is it possible to exclude a complete namespace from all FxCop analysis while still
I have to create a class that will load all the dll's from repository
Namespace are pretty cool: with them, you can organize your libraries and you can
The .NET System.Security.Cryptography namespace has a rather bewildering collection of algorithms that I could
When authoring a library in a particular namespace, it's often convenient to provide overloaded
I have an enum in a low level namespace. I'd like to provide a
Brainstorming needed . I have a problem with Javascript libraries (jQuery, ExtJS etc.) that

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.