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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:48:48+00:00 2026-05-30T15:48:48+00:00

I have a C# library with lots of internal functionality exposing only a few

  • 0

I have a C# library with lots of internal functionality exposing only a few public classes and interfaces. I would like to share this code between several projects, and each project may need to extend the internal classes with subclasses.

I don’t like the idea of making all these classes public in order to create a common library. I think it exposes them too much to easy decompilation and break the design.

Is the only real option to create a copy of the source code and keep those files in sync between projects? Or is there some way I can share code and still get a single library for each project exposing only the few intended public interfaces and classes?

I’m using Visual Studio 2010.

UPDATE

Thanks for the clarification regarding decompilation and “private” access. I think I could consider applying an obfuscator over several input libraries, all together, hopefully obfuscating even their public connections.

From the design standpoint, seems like the answer is definitively to use friend assemblies.

  • 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-30T15:48:50+00:00Added an answer on May 30, 2026 at 3:48 pm

    You may want to look at doing friend assemblies:

    http://msdn.microsoft.com/en-us/library/0tke9fxk(v=vs.80).aspx

    [assembly:InternalsVisibleTo("someassembly")]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a OCaml library with lots of classes I need some translator to
I have a library that I would like to license and distribute. I know
I have a library written in C that I would like to use in
I have an class and I would like to use the standard library list
Of course most languages have library functions for this, but suppose I want to
I have to use an extern library providing lots of free functions that do
OK, so I have this tiny little corner of my code where I'd like
I'm using an open source library which seems to have lots of preprocessing directives
I have lots of existing business logic in C# assemblies, and I'd like to
I have seen lots of library written in C and C++ programming languages in

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.