VS2010 Web Deployment Package - Prevent App_Data from Being Deleted - visual-studio-2010

I want to deploy an update to a website using the Web Deployment capability of VS2010, generally following this guidance:
http://msdn.microsoft.com/en-us/library/dd465337.aspx
The production website uses certain data files in App_Data that are generated and deposited there by a separate service.
When I do a test deployment of my update:
MyDeploymentPackage.cmd /T
I get a message that everything in App_Data will be deleted. If I uncheck the checkbox "Exclude files from the App_Data folder", I instead am informed that the files will be updated with an old copy of the files from the QA environment (if said files are included in the project), or that the specific files will be deleted (if the QA copy is not included in the project).
Is it possible to use a Web Deployment Package such that it just leaves App_Data alone?

Related

How to deploy the entire project to IIS

I'm trying to publish my ASP.NET Core 5 MVC application from Visual Studio to IIS Web Server (on VPS). But all my Areas folders, Cshtml files, view components etc, have not been published - only the wwwroot folder and its contents have been uploaded to the server. I saw about project.json, but .NET 5 doesn't use it anymore.
PS: when I try publishing clicking directly from the "Area" folder selected, the files are published, but the .Cs files are published too.
How can I fix it?
On publishing to Microsoft Azure, everything goes fine. But to my VPS it is not working as I would like to.
The easiest way is open scm site, check the publish file under D:/home/site/wwwroot. And compare the structure of deployed file between azure and IIS. It should be same.
After the comparison, see if the folders or files are not included. Just modify it in the .csproj file.
Related posts:
1. Unable to find files located in my root project folder when hosted on Azure
2. dotnet core publish: include/exclude dir in output

Publish web app but not overwrite app_data but delete existing files?

Ok, I guess I never got this sorted out or cant remember how to preserve the app_data folder when using a publish profile from within vs. Have a older webforms project using vs 2019 and published to a folder on a server using a unc path. Works fine, but I need to not overwrite the app_data folder.
In the publish profile there are a few options such as
delete exsting files
exclude files in app_data
If I want the app_data folder left intact on the target, then should I not use delete existing files? Trying that, even with exclude files from app_data, the app_data folder is still deleted. Only if I uncheck "delete existing files" does app_data on the target stay intact.
We can avoid deleting the App_Data folder when publishing by using below command:
-skip:Directory=\App_Data
Check these links:
Make MSDeploy (Visual Studio) not delete App_Data folder but delete everything else
https://forums.iis.net/t/1191873.aspx?Avoid+deleting+App_Data+folder+when+publishing+
Delete existing files will delete all files in the physical path of the website before publishing the updated files.
Ticking exclude files in App_data means the files of the current App_Data folder will not be published into the physical path of the website resulting in that the existing AppData directory in the website will be preserved.
Feel free to let me know if there is anything I can help with.

How to publish App_Data folder to IIS 8 using MsBuild?

I am using a TeamCity build that has been working for the past several years on IIS 7.5 installations. I have recently upgraded to IIS 8 and I am finding that the App_Data directory is not being deployed when I execute my MsBuild script.
Our TeamCity build deletes the entire IIS site directory contents during each publish to ensure that we start with a clean slate and don't have an lingering files. I need to continue to do this but now all of the sudden I can longer automatically push out the App_Data folder during the publish step. I have even tried adding a dummy Placeholder.txt file to the folder (and set the BuildAction to content in Visual Studio) but the App_Data folder still does not appear on my web server. Any help would be greatly appreciated.
So... it turns out that all I had to do was add some content to the Placeholder.txt files. Seems like the deployment tools were skipping the files since they were empty.

Teamcity not deploy app_data folder

I have configured Teamcity to deploy my ASP.NET MVC application to my production server via web deploy.
The whole process is working as expected except that teamcity doesnt deploy my files in app_data folder.
If I deploy my site from Visual Studio the folder is created as expected but not by teamcity deployment.
Any suggestions how this can be updated,
Make sure the app_data folder is included in your project. When using teamcity along with msdeploy it will not by default deploy any files which arn't included in the project. Right click on it and see if it says "include in project" or "exclude from project".
Also make sure you SVN ADD (or whatever your SVN system uses) as this is a common mistake to commit and forget to SVN so it never gets deployed.
Lastly, the files in APP_Data, are they set as content or compiled or none. If they are set to none it won't be deployed.
Once its incuded check in the .csproj file.
Check
Build Configuration Settings->Parameters->System Properties -> system.ExcludeApp_Data
value must be false

Problems Building a WCF Project with TFS 2010

I have a WCF project with a single .svc file and some .config files in it. I'm trying to create a build definition in TFS 2010 that will copy these files to an IIS folder on another machine.
I've done similar things with other MVC projects using the CopyDirectory task in the build XAML template. In those, I copy from the _PublishedWebsites folder to the IIS folder. However, with the WCF project, there is no _PublishedWebsites folder.
So I tried updating the MSBuild script for the WCF project to create a _PublishedWebsites folder and copy the files to it. This works when I build locally in Visual Studio 2010. But when it runs on the TFS build server, it doesn't quite work.
What I see there is that in "C:\Builds\1\PROJECT\PROJECT (Continuous Build)\Sources\PROJECT\bin\_PublishedWebsites", I can see all the files.
I'm guessing this "1 folder" is a temporary folder used for building...? I'm not sure what it's used for. But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files. None of the files from the "1 folder" are there.
Note that this same solution also has a WiX project to create a deployment package. That seems to build fine, and shows up in the drop location with no issue.
"1 folder" is a temporary folder used for building
Yes. "1" is number of build agent(service that actually executes builds activities) on your build machine.
But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files.
- Usually "Copy Files To Drop Location" flag is responsible for that.

Resources