Reputation: 22179
Visual Studio projects assumes all files belonging to the project are situated in the same directory as the project file, or one underneath it.
For a particular project (in the non-Visual Studio sense) this is not what I want. I want to store the MSVC-specific files in another folder, because there might be other ways to build the application as well, for example with SCons. Also all the stuff MSVC splurts out clutters the source directory.
Example:
/source
/scons
/msvc <- here is where I want my MSVC-specific stuff
I can add the files, in Explorer, to the source
directory manually, and then link them in Visual Studio with the project. It's not the end of the world, but it annoys me a bit that Visual Studio tries to dictate the folder structure of my project.
I was looking through the schemas for the project files but realized that this annoying assumption is in the IDE and not the format of the project files.
Do someone know a neater way to solve this than manually linking files to the project from the source
directory?
Upvotes: 7
Views: 4247
Reputation: 141
You can add files with links like this, they are searchable, view-able, but they do not checkout if you try to change them, also visual studio leaves the wildcards in place:
<ItemGroup>
<Content Include="..\Database Schema\Views\*.sql">
<Link>Views\*.sql</Link>
</Content>
</ItemGroup>
This goes inside the .proj file.
Upvotes: 3
Reputation: 35911
I use this sometimes, pretty sure it's what you want:
Show All Files
option is on in your solution explorer.mklink /j target source
For the example project structure you show, you'd run mklink /msvc/source /source
and in the project the source directory will show up as if it was in the project dir (well, actually it is). Additional bonus: adding new items through VS also automatically puts them in the right directory.
Upvotes: 4