Publish: Do not copy files in folder App_Data

Bernd Morgeneyer 0 Reputation points
2024-11-22T10:46:08.7733333+00:00

My ASP.Net Application has been developped several years ago with Visual Studio Express 2013 for Web. Now I edited it with Visual Studio 2022 and published it using the Publish... command. Here I checked the "Do not copy AppData folder" option.

I realized that the folder App_Data now obviously has been renamed to AppData (without underscore). Does this meen that all content of my App_Data folder will be copied? Do I have to rename folder App_Data to AppData?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,532 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,248 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,101 Reputation points Microsoft Vendor
    2024-11-22T13:35:59.7566667+00:00

    Hi @Bernd Morgeneyer, 

    Welcome to Microsoft Q&A! 

    Where did you check the "Do not copy AppData folder" option? 

    I created a ASP.NET application and only found an option “Exclude files from the App_Data folder” on Publish Settings.

    User's image

    If I checked the option “Exclude files from the App_Data folder”, the Visual Studio will not copy the App_Data folder when publishing. 

    If I renamed the App_Data into AppData and check the option “Exclude files from the App_Data folder”, VS will copy the AppData folder into the target location like the following.

    User's image

    To avoid confusion, I don’t recommend you rename the App_Data folder to AppData.

    If the App_Data folder has already been renamed to AppData, you can try to manually rename the folder back to App_Data.

    Besides, you can create a new ASP.NET application in VS2022 and consider migrating the code into a new project. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.