locked
App_Data folder location in deloyment package RRS feed

  • Question

  • User-1323827407 posted

    Hi

    I have a App_Data folder in my web app and the files of this folder are set to "build action = content & Copy to output directory:copy always". Once I create a deployment package and deploy it, the App_Data folder is copied under bin folder instead of approot folder which contains the Bin folder. Can you please confirm if App_Data folder being copied to Bin folder in deployment package is not an error but by design by ASP.NET team?

    I can't find the folder structure definition of deployment packages in MSDN so is the confusion. Thanks

    Note: I am using Visual Studio 2010 to create deployment package by right clicking on the web app project.

    Sunday, May 29, 2011 2:53 PM

Answers

  • User1182340765 posted

    In VS, copy to output directory means copy to the folder where the compiled assemblies reside. As bin folder is the place the system put assemblies, it is not an error.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 29, 2011 5:36 PM
  • User1642585364 posted

    You don't need to copy it to the output directory.  For ASP.NET web sites and web applications, most of the content resides in the directory above the executable; another way of looking at it is that the assemblies are kept in a child folder of the site root (/bin).  To include the files in your deployment package, setting them to Build Action=Content and Copy To Output Dir=Never should be sufficient.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 31, 2011 2:09 PM

All replies

  • User1182340765 posted

    In VS, copy to output directory means copy to the folder where the compiled assemblies reside. As bin folder is the place the system put assemblies, it is not an error.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 29, 2011 5:36 PM
  • User1642585364 posted

    You don't need to copy it to the output directory.  For ASP.NET web sites and web applications, most of the content resides in the directory above the executable; another way of looking at it is that the assemblies are kept in a child folder of the site root (/bin).  To include the files in your deployment package, setting them to Build Action=Content and Copy To Output Dir=Never should be sufficient.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 31, 2011 2:09 PM
  • User112724084 posted

    Set buid action for the files you want to publish as "Content"

    There is a option checkbox during the publish if you are using VS2008

    Since you are using VS2010, right click properties ->Package/Publish Web->Exlude Files App_Data Folder

    check this blog: http://vishaljoshi.blogspot.com/2009/07/exclude-appdata-folder-from-deployment.html

    Sunday, October 27, 2013 3:54 PM