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.
Related
Publishing my local site to an Azure profile with web deploy method. If I delete a file and publish, the file remains on the server. I've seen similar versions of this question with answers suggesting either to check the 'delete all files when publishing' (not an option in VS 2017) or to delete bin and obj folders and re-publish (tried several times).
Any other suggestions on getting files to sync when publishing?
You could right-click your project -> publish, then follow the screenshots below to check the option Remove additional files at destination.
I am working on TFS 2012 Builds. I have created a build template to deploy Asp.net application and its working properly but its deploying full build every time.
I need to deploy
1. Only changed files
2. I don't wanna deploy folders like 'Uploads or Attachments etc'
3. I don't want to deploy Web.config file
I have searched for MSbuild arguments but didn't get result , also SkipUnchangedFiles didn't work in 2012 TFS.
Can you guys help me achieve these result.
Thanks
First, you can set Clean Workspace to None in the build definition. This will speed up the build times by only building what has changed. In this way, your output dir will contain all of the old and new files.
Then you can override the AfterCompile target to delete any file whose timestamp is older than (current time - 1hr). After the delete operation, your out dir folder will only contain the new files. The Build will then copy those files out to the Drop folder. Now your drop folder will have the files you need to deploy.
Check: https://social.msdn.microsoft.com/Forums/vstudio/en-US/32a4f153-846f-4acb-bcca-018d6143a50a/build-tfs-build-only-what-is-changed?forum=tfsbuild
I have an issue. We are upgrading to VS 2012 at work. When we open a VS 2010 project Visual Studio converts the project. This is fine, because VS 2010 can still use the project (yay microsoft). However, there is a \Backup folder created in the solution directory. Is this being created as part of the migration? Is there any way to control it?
The reason I ask is that the process that makes this folder copies web.config files into the folder. If you then try to build the solution (these are MVC projects), we get a "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." error. The cause is that there is a web.config file in a subfolder instead of the root folder. We did not make and do not want this change, and cannot figure out how to control it. Deleting the Backup\Web.config file fixes the error. Renaming it from web.config to web.config.bak fixes the problem.
I don't really want to have to personally open and convert every single project, and don't want random people bumping into this problem. Any idea how to either stop VS from creating the Backup folder, or how to make it create them in the my documents studio folder etc? I can't find any setting to control this and can't find any good info.
By chance, are you using the MvcBuildViews property to pre-compile your views at build time? If so, this is why you're encountering this (since it does the pre-compile in the same directory, it doesn't filter out any of the files below the project directory).
Note that you will also encounter this issue if you use the Publish feature for this project. Publish copies the web.config under your intermediate build output directory (by default, obj/) before and after applying web.config transforms.
The good news is that in VS2012, or in VS2010 with the latest Azure SDK installed, pre-compile is now supported for Web Application Projects (including MVC). These settings are currently in the project properties, under the Package/Publish Web tab.
(this doesn't directly address your question about the Backup folder, but it was too long for a comment.)
There is no way to control it that I found. We had to go ahead and run through and convert every project to 2012 and delete the backup folders to prevent any other team from running into it.
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
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.