Visual Studio Resource Project Type?

In Eclipse you can create a project type “resource”, which basically is just a folder with some files in it, but visible as a separate project in the “solution”. How to do this in Visual Studio?

Solution packages seem to be closed, but I don’t think you can add a solution folder from an existing folder on disk, right?

For example, I have a folder called Build with some build files and subfolders. I want to be able to edit these files directly from Visual Studio, how to make them visible in the solution folder without manually re-creating the folder structure using solution folders, etc.?

+4
source share
2 answers

The workaround is to add an empty website to the solution - although it defines some unnecessary things, such as the configuration of the web server, it reflects the file system, and this is the main thing.

Right-click Solution -> Add -> Add New Site ... -> Empty Web Site

0
source

Unfortunately, you cannot simply add / import an existing folder and all its subfolders in one step, and Visual Studio does not have a concept of the type of project "resource" as you describe it. You can (as you suggest) use the Solution folders for this purpose, however you must first recreate the folder hierarchy in the solution explorer, for example:

  • R-click on the project folder (or any subfolder) and select "Add" → "New folder" (for C # projects) or "Add" → "New filter" (for C ++ projects). Then enter the name of the folder you want to add. ( Build , in your example)
  • R-click on the newly created folder (still in Solution Explorer) and select "Add" → "Existing item ...". Then go to the appropriate folder on the disk and select all the files / items in this folder that you want to add.
  • Repeat this process for all subfolders.

(Note that the folder structure in Solution Explorer is not required to match the hierarchy on the disk. This allows, for example, placing all your header files and source files in separate folders in Solution Explorer, but saving them in one folder on disk.)

+2
source

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


All Articles