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?

3 Answers 3

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.

3
  • 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
    Commented Apr 18, 2013 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
    Commented Apr 18, 2013 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
    Commented Sep 8, 2015 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>  
1
  • Which file are you adding this to?
    – Stavros_S
    Commented Nov 30, 2017 at 22:40
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.