I created several projects in one Visual Studio solution. You can add a solution folder and files to it, as far as I understood, pertaining to all projects at once. But toli because of problems with the namespace, toli due to the fact that I do not know access, I cannot get values ​​from the “common to all class” files from the project files.
In general, I want to create one common static class in this folder for all projects at once and store parameters in it and have access to them from all projects of this solution.
How to do this?

    1 answer 1

    The classic version is to select the common parts of your projects in a separate project and place it in the solution. And in target projects, add a link to this shared project and its public classes will be available in the usual way, by full name (indicating namespace) or short if namespace is specified in the first using directives.

    • I created the Settings class in the solution folder and it lies in the NamespaceSettings namespace. When I try to connect this namespace in a studio project, it sees nothing - Rakzin Roman
    • one
      @RakzinRoman so it will not work, the studio is so arranged. You can add documentation to the solution folder, perhaps separate resource files, but the code should be drawn up by the project. - rdorn
    • one
      @RakzinRoman and do not forget to add a link to the common project in the references, but I already wrote about this. - rdorn
    • class public, static. But when I try to write using NamespaceSettings, the studio curses. All projects are isolated and have nothing to do with the general file, although they are in the same solution - Rakzin Roman
    • one
      Again. You add a new project to the solution, namely the project and not the folder. In it you create classes that are common to all. After that, right-click on the necessary projects in the refferences folder and add a link to your common project. - rdorn