Not to my knowledge; however my suggestion is to paste them into the project as this will include them by default. So, instead of pasting them into the directory via Explorer, use Visual Studio to paste the files into the folders.
You simply can extend your website .csproj file. Just add your content root folder with a recursive wildcard:
...
<ItemGroup>
<!-- your normal project content -->
<Content Include="Default.aspx" />
<!-- your static content you like to publish -->
<Content Include="Images\**\*.*" />
</ItemGroup>
...
Doing so makes this folder and all content below visible inside your solution browser.
If you try to hide the folder inside the solution browser by specifying
As you already discovered the wildcard will be replaced as soon as you touch the folder inside your solution because VS projects are not designed to contain arbitrary content.
So you will have to make sure the folder and its contents are never modified from within VS - adding or removing files can only be done on the file system ... which is what you wanted as i understood your question.
It would be easier if the folder could be hidden in VS but i couldn't find a way to hide it AND publish.
Another unsuccessful approach was to include the folder by a CreateItem Task.
This resulted in the contents of folder being published to \bin\app.publish\... and could not be convinced to publish it together with the content items inside the .csproj so i did not present it in my answer.
Old thread, I know, but I found a way to do this that I keep forgetting, and on my search to find it one last time, I stumbled upon this question. The best way I've found to this is is to use the BeforeBuild target in the .csproj file.
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:
I realized that best solution for this is manually add files, one by one. If you have hundreds of them as I did it was just a matter of few hours. Funny that even in 2016 with VS 2015 this serious problem is still not solved. Ahh, how I love Xcode.
As Chris mentioned in his answer - Visual Studio will not touch this <Target> section, even if you manually fiddle around (adding/removing files) with the target directory.
Please note that you should include a subdirectory where the files are located (in the case above, it's images). Visual Studio/MSBuild will place those files in the same directory within the project structure. If you don't use a subdirectory, the files will be placed at the root of the project structure.
For a quick explanation of the wildcards:
** means everything recursively (files, subdirectories, and files within those)
*.ext will include all files with extension ext within the top-level directory, but not subdirectories
For example, *.ext could be *.png, *.js, etc. Any file extension will work
**\*.ext will include all files with extension ext from the top-level directory and all subdirectories.
The non-<Target> approach will instruct Visual Studio to show the files within the Solution Explorer. The drawback with this one is that any manipulation of the automatic directories will cause Visual Studio to override the wildcard entry. It should also be noted that the approach below will only update the Solution Explorer upon opening the Solution/Project in VS. Even the Solution Explorer's "refresh" toolbar button won't do it.