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.
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.
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.