Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are certain files not published in the App_Data folder?

I'm using Visual Studion 2008 to build and deploy a webservice project. I've added a bunch of files to the App_Data folder: some xml, some plain text and 2 pdf's. All these files are included in the .csproj file (if they are not, they will not be published) But when doing a 'publish' from VS2008 (of course with the option 'Included files from the App_Data folder' selected) the pdf's are NOT published. I have tested this with both 'replace' and 'delete' options selected.

Does anyone know why certain files, in this case PDF's, are not published?

like image 460
edosoft Avatar asked Aug 12 '09 14:08

edosoft


People also ask

What is App_Data folder?

The AppData folder includes application settings, files, and data unique to the applications on your Windows PC. The folder is hidden by default in Windows File Explorer and has three hidden sub-folders: Local, LocalLow, and Roaming. You won't use this folder very often, but this is where your important files reside.

What is App_Data folder in ASP NET MVC?

The App_Data folder of MVC application is used to contain the application related data files like . mdf files, LocalDB, and XML files, etc. The most important point that you need to remember is that IIS is never going to serve files from this App_Data folder.


1 Answers

In the solution explorer right click your pdf's and look at the properties. Change the Build Action from 'None' to 'Content'. The files should now be published with the rest of the project.

like image 97
Paul Avatar answered Oct 03 '22 07:10

Paul