Reputation: 5016
I am using the Publish / Web Deploy option within VS 2010 to publish my ASP.NET MVC3 website.
However it does not by default publish my "files" folder that I have highlighted below.
Any ideas how I can get this file included during publishing?
Thanks Paul
Upvotes: 13
Views: 12096
Reputation: 2285
In my case, the Error.txt file was not included in the Project
and the Folder was not added during the Publish project.
I right-click the file name and click on
"Include in Project"
Upvotes: 3
Reputation: 946
In my case I couldn't see the option to set files' Build Action to Content so I had to:
Also, make sure that when you right click on file > Properties, the "Copy to Output Directory" is set to either "Always Copy" or "Copy When Newer".
Upvotes: 1
Reputation: 2072
A probably less common case is when someone (maybe yourself) added a <ExcludeFoldersFromDeployment>Content\files</ExcludeFoldersFromDeployment>
line in the csproj file, and then forgot about it, and later you do want to publish the folder.
Because of this line, none of the files in Content/files (and subfolders) will be deployed, even if the BuildAction is Content
.
This is hard to spot because, AFAIK, it is not visible anywhere in visual studio, you have to open the csproj file with a text editor.
Upvotes: 1
Reputation: 2736
Within the Visual Studio Solution Explorer you need to right-click and select properties on each of the files within that directory (you can select them all at once and then right-click -> properties if you want to change them all).
Make sure the Build Action is set to Content. This will ensure that the files are copied as part of the publish process.
Upvotes: 29