[ACCEPTED]-Folder not uploading with VS Publish / Web Deploy-one-click-web-publishing
Within the Visual Studio Solution Explorer 8 you need to right-click and select properties 7 on each of the files within that directory 6 (you can select them all at once and then 5 right-click -> properties if you want to 4 change them all).
Make sure the Build Action 3 is set to Content. This will ensure that 2 the files are copied as part of the publish 1 process.
In my case,
Error.txt file was not included in the Project
and due to that Folder was 2 not adding during the Publish project.
I 1 just right click the file name and click at
"Include in Project"
A probably less common case is when someone 9 (maybe yourself) added a <ExcludeFoldersFromDeployment>Content\files</ExcludeFoldersFromDeployment>
line in the csproj 8 file, and then forgot about it, and later 7 you do want to publish the folder.
Because 6 of this line, none of the files in Content/files 5 (and subfolders) will be deployed, even 4 if the BuildAction is Content
.
This is hard to spot 3 because, AFAIK, it is not visible anywhere 2 in visual studio, you have to open the csproj 1 file with a text editor.
In my case I couldn't see the option to 6 set files' Build Action to Content so I 5 had to:
- Right click on the folder > "Exclude From Project"
- Right click on the folder > "Include In Project"
Also, make sure that when you right 4 click on file > Properties, the "Copy 3 to Output Directory" is set to either 2 "Always Copy" or "Copy When 1 Newer".
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.