I have a tool which dynamically generates .xaml and .xaml.cs files and puts them in the appropriate Visual Studio directory.
To add them to the project, I have to then:
Is there a way for me to tell the project to "include all existing items under the project folder on the hard drive"?
You can add existing files to your project by right-clicking on the Project node and selecting Add > Add Files.... Alternatively, to add an entire folder, select Add > Add Existing Folder.... The file browser is shown. It lets you search your system for the required item to add.
Add files to a solution To add an item to a solution, on the context (right-click) menu of the solution node in Solution Explorer, select Add > New Item, or Add > Existing Item. A solution file is a structure for organizing projects in Visual Studio.
On Linux, the existing file can be inserted by copying to system's clipboard then paste from VSC. Then paste to VSC as usual using Ctrl-V.
You can do this programatically in your .proj
file depending on your needs just like this answer
You just have to make sure you use the correct tag for the files.
Compile, Content, None, etc..
<ItemGroup>
<Content Include="Images\**\*.*" />
<Compile Include="Subdirectory\**\*.cs" />
</ItemGroup>
I do not have any automation for this. Still I follow following for the same requirement. This will avoid few clicking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With