Michael is totally right, through editing the .csproj file you can manually exclude files/folder from being published.
One easier way if you don't want to mess with the .csproj file is to highlight the file(s) inside the VS solution explorer. Under the properties panel, change build to action from 'content' to 'none'.
This way you don't have to unload the project from the solution, load the .csproj and add a line for each new file you add that doesn't need to be published but instead achieve the same with 3 mouse-clicks.
(assuming you've set the 'Only publish files needed to run this application' under the publishing tab)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…