Question when adding a project to a Visual Studio solution

I created a completely new empty Visual Studio 2010 solution and added an existing C # project to it. I built the solution and compiled it correctly.

But when I go to the solutions folder, I see that the imported C # project is not physically located in this folder. It seems that he refers only to the project, wherever he is.

Is this intended? Do I even have to worry about this?

How to create a physical import, that is, the project will be copied to the solutions folder?

enter image description here

+4
source share
3 answers

How to create a physical import, that is, the project will be copied to the solutions folder?

If you want to do this, copy the project into the solution (outside VS), then add the local copy directly.

The default behavior allows you to share a project between two solutions. This is sometimes useful (when handling with care).

+4
source

'How to create a physical import?

You do not - you add the project to the solution, which will always lead to the fact that it is referenced on the spot. To structure your solution, you need to copy or move an existing project to the desired folder, create any desired Solution Folder so that it matches the physical structure, and then Add existing project as necessary.

Another option is Add new project , and then copy all your project data from the existing one, but this will be error prone at some levels.

+1
source

Adding an existing project always refers to the original. This makes sense in many cases. If you want to use the project in a number of solutions, and you want to make sure that they always use the same version, then you have the choice to either just reference the compiled library or have it in each solution. If you have this in every decision, then the risk is that you will make some mod in one solution that will break the others. I am very good at that!

As already mentioned, if you want to change this project and do not mind if it does not synchronize with other versions, you need to copy it to the folder with your solution and then add it from there.

The versioning software I use makes me pretty much do it because it doesn't look like code that is not inside the decision tree.

+1
source

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


All Articles