Can I open only part of the common .NET DLL classes through another "API" DLL?

I am developing a WPF application that uses a DLL with 40 public classes. I need them to be publicly available for a variety of reasons, including the ease of data binding and obfuscation. I would like to allow other people to use only part of these classes as an API for my software.

It seemed to me that I would create the main library (core.dll) and the API library (coreAPI.dll) using the API API, which can be referenced in a new project. Is there a way to allow coreAPI.dll to expose only some of the classes existing in core.dll? This is not so much a security issue as, first of all, I just want to hide some of the unwanted classes from Visual Studio Intellisense.

Again, inner classes for the ones I want to hide are not really an option, because I need the data to bind some of these classes in WPF, and for this to be public. Are there any other ways to do this?

+3
source share
2 answers

As Damien already mentioned, if you just want to hide from Intellisense, you can add the following attribute to your hidden classes:

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+3
source

If Intellisense is the main problem, then moving these classes to a separate namespace will certainly do the trick?

, . , , ( ), InternalsVisibleTo

0

Source: https://habr.com/ru/post/1743937/


All Articles