Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folder not uploading with VS Publish / Web Deploy

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.

enter image description here

Any ideas how I can get this file included during publishing?

Thanks Paul

like image 730
Paul Brown Avatar asked Apr 19 '11 09:04

Paul Brown


People also ask

What is difference between publishing deployment?

Like when publishing website actually means delivery to a customer or in SaaS where deployment often means delivery or in packaging where deploying is done simply through installing. Second source of confusion is where publishing is delivery to customer, but they do their own deployment afterwards.

What is the difference between dotnet build and publish?

Build compiles the source code into a (hopefully) runnable application. Publish takes the results of the build, along with any needed third-party libraries and puts it somewhere for other people to run it.

How do I publish a file in Visual Studio?

To publish from Visual Studio, do the following: Change the solution configuration from Debug to Release on the toolbar to build a Release (rather than a Debug) version of your app. Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish.


1 Answers

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.

like image 52
youen Avatar answered Oct 14 '22 18:10

youen