Publish web app but not overwrite app_data but delete existing files? - visual-studio

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.

Related

"Files already in version control are hidden" but I cannot find them them in TFS?

Steps I made leading up to this problem:
I created a project in Visual Studio Online (TFS) and checked in the entire contents (about 200mb) of a folder called classic.
I created another project and checked in the entire contents of a folder called dlls.
I decided that it would make more sense if these two folders were apart of the same project, so I deleted both of the ones I created in steps 1 and 2.
I created a new project and mapped it to a folder on my computer that contains both the classic and dlls folders.
In Visual Studio 2013, I go into "Source Control Explorer", right click and select "add existing item", and try to add both folders.
In this prompt, none of the files that I need to add are shown! The prompt gives me a message at the top that says "Files already in version control are hidden". If I click through each folder they are blank except for other folders. I verified that the files are still there on my local machine.
The problem is, I deleted those 2 projects in TFS that had the files. Do those projects still exists somewhere? How do I completely get rid of them? Where can I find those files at if they are "already in version control"?
This may be happening because even though you deleted the files from the server, you local workspace still thinks they are available on the server. The easiest way to recover is if you can delete your workspace and recreate it. Be careful not to delete your local files without creating a backup.

VS2010 Web Deployment Package - Prevent App_Data from Being Deleted

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?

TFS 2010 - Deleting a folder in Visual Studio solution before check-in of changes

We are using TFS 2010 and facing a problem with deleting a folder inside of a solution in Visual Studio.
In the latest version of checked-in code, the directory in question has files in it.
One of the developers decided to move the files in that directory to another location within the solution. He then tried to delete the old folder but go the following error:
This operation cannot be completed.
You are attempting to remove or delete a source-controlled item where the item is either exclusively locked elsewhere or otherwise unable to be deleted from source control.
Does anyone know what the problem is with trying to do this and is there a way to get around it?
You cannot delete a folder that has pending changes on any of its children (including if any of those children are being moved out of the folder - they're still children until that changeset is checked in.)
You'll have to do this in two steps: first, move the children out of the folder and check those changes in, then delete the folder as a separate changeset.
If the folder you want to delete exists on your local machine, just add a new file to the folder from within the Visual Studio IDE (it doesn't matter what type of file). Then you should be able to delete the folder from within VS.
If the folder was deleted from your local machine, create a new one with the same name and then follow the above steps.

how to ignore a local folder in a vs.net solution from being updated to TFS?

how to ignore a local folder in a vs.net solution from being updated to TFS?
I have a web service reference, and I don't want this being saved to the TFS source control.
Each time I check-in, the service folder and its 1000's of files are pre-selected.
Navigate to File > Source Control > Change source Control and choose the folder that you to exclude and unbind the mapping of that folder to your workspace.
You could remove the folder from Source Control. This will also delete the folder on the local file system, so make sure to make a copy of the sources first.However Visual Studio will add the files to Source Control once you add the files to the project again, so it might not work.
Another option, however not sure if it will work, is to cloak the folder in the workspace mapping.

How do you create a copy of a VS2005 solution while disassociating it from VSS?

I copied the root folder to my desktop, deleted all files in that folder or under that folder if the file was a VSS file, opened the project, confirmed that I wanted to removed VSS integration and still my web project but not the referenced projects in the solution were tied to VSS and they changed my checkout folder in VSS!
You should also remove the source control related settings from the sln file.
Look for hidden .vss files.

Resources