4

According this answer, it should be option "include files from the App_data folder" when you publish ASP.NET application. But I don't see it: enter image description here

Where it is?

Community
  • 1
  • 1
Alexan
  • 8,165
  • 14
  • 74
  • 101

3 Answers3

11

I don't believe that option is in the newest of Visual Studio.

Instead, you should be able to change the Build Action to "Content" by right-clicking on the files in Solution Explorer and clicking "Properties."

This should then include them in the publishing process.

Nate Dudek
  • 1,245
  • 10
  • 12
  • it isn't newest, it's VS 2010. Okay, I clicked right button -> Properties, but don't see Build Action. I see only Folder Name. – Alexan Apr 18 '13 at 16:19
  • 1
    It's the newest version of Web Deploy. If you right-click on "App_Data," then you will only see Folder Name. You have to right-click on the individual files that you want to include. – Nate Dudek Apr 18 '13 at 16:25
  • 1
    Hi Nate, If there are no files to include and still i want to include App_Data folder during the publish, what is the option i m left with? – TechQuery Sep 08 '15 at 16:17
2

I used a After Build Target. To just create a empty folder on deploy.

Add this to the end of The project file .csproj

<Target Name="CreateDirectories" AfterTargets="GatherAllFilesToPublish">   
    <MakeDir Directories="$(OutputPath)App_Data\"/>  
</Target>  
Lord Darth Vader
  • 1,895
  • 1
  • 17
  • 26
1
  1. Manually Create the App_Data folder under the published application's root folder
  2. Right click at the App_Data folder and select Publish App_Data folder.
  3. Add an item into the App_Data folder and set the item to be include in the publish.

https://forums.asp.net/t/2126248.aspx?App_Data+folder+missing+in+release

Valentin Petkov
  • 1,570
  • 18
  • 23