I am in the process of using Teamcity for automated build and deployment to prod servers. Dont know how to publish App_Data folder to a virtual directory on IIS web application where its shared for load balancing servers. Any help would be great? Can we
publish to virtual directory using team city. Any help would be great.
Sorry to jump in here with no Teamcity experience, but if your app_data folder contains a database, you have a bit more work to do then simply publishing to a production web server.
Your production environment must have a database solution installed and available. There are a number of processes available to export and create the database schema from your development machine on the production server, depending of course on what program you
are using. Sql, MySQL, Access, etc.
If you are not using a database you can disregard this post, but at least explain what is in the app_data folder that you need to publish on the production server.
Thanks for replying. Actually, we have 2 servers where we are using for production servers with load balancing. App_Dat folder contains all the config files which are shared between 2 websites using a virtual directory and sits on a different server. 1st
step is to publish the App_Data folder to websites which are configured as Virtual Directory. If web deploy works then using TeamCity auto build and deploy to servers.
1st step is to publish the App_Data folder to websites
Under Settings, make sure Exclude files from the App_Data folder is not selected.
Note: Web Deploy will not create a folder in the destination site unless there's at least one file to copy to it. Therefore, you'll add a .txt file to the folder to act as a placeholder so that the folder will be copied.
In Solution Explorer, right-click the App_Data folder, select Add New Item, and create a file named Placeholder.txt. Put the following text in it: "This is a placeholder file to ensure that the folder gets deployed." and save the file. That's all you have
to do in order to make sure that Visual Studio deploys this file and the folder it's in, because the Build Action property of .txt files is set to Content by default.
Hi Thanks, Chris Publishing works fine if the App_Data folder is set as single website without not set as a Virtual Directory to share between to nlb servers.
I have content inside my App_Data folder . That is config files and other files. I want to publish the App_Data folder which is set up as a virtual Directory inside the website in both servers nlb1 & nlb2 which are pointing to \\191.234.123.111\website
storage\App_data which is in other machine -->
Member
10 Points
27 Posts
Publish App_Data folder to Virtual directory in Visual Studio 2013
Jan 24, 2017 10:01 AM|Jim2401|LINK
I am in the process of using Teamcity for automated build and deployment to prod servers. Dont know how to publish App_Data folder to a virtual directory on IIS web application where its shared for load balancing servers. Any help would be great? Can we publish to virtual directory using team city. Any help would be great.
Contributor
2155 Points
2142 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Jan 26, 2017 02:38 PM|march11|LINK
Sorry to jump in here with no Teamcity experience, but if your app_data folder contains a database, you have a bit more work to do then simply publishing to a production web server.
Your production environment must have a database solution installed and available. There are a number of processes available to export and create the database schema from your development machine on the production server, depending of course on what program you are using. Sql, MySQL, Access, etc.
If you are not using a database you can disregard this post, but at least explain what is in the app_data folder that you need to publish on the production server.
Member
10 Points
27 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Jan 26, 2017 03:42 PM|Jim2401|LINK
Hi March 11,
Thanks for replying. Actually, we have 2 servers where we are using for production servers with load balancing. App_Dat folder contains all the config files which are shared between 2 websites using a virtual directory and sits on a different server. 1st step is to publish the App_Data folder to websites which are configured as Virtual Directory. If web deploy works then using TeamCity auto build and deploy to servers.
All-Star
17652 Points
3510 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Jan 31, 2017 02:20 AM|Chris Zhao|LINK
Hi Jim2401,
Under Settings, make sure Exclude files from the App_Data folder is not selected.
Note: Web Deploy will not create a folder in the destination site unless there's at least one file to copy to it. Therefore, you'll add a .txt file to the folder to act as a placeholder so that the folder will be copied.
In Solution Explorer, right-click the App_Data folder, select Add New Item, and create a file named Placeholder.txt. Put the following text in it: "This is a placeholder file to ensure that the folder gets deployed." and save the file. That's all you have to do in order to make sure that Visual Studio deploys this file and the folder it's in, because the Build Action property of .txt files is set to Content by default.
reference: https://www.asp.net/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis
Best Regards,
Chris
Member
10 Points
27 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Feb 02, 2017 09:23 AM|Jim2401|LINK
Hi Thanks, Chris Publishing works fine if the App_Data folder is set as single website without not set as a Virtual Directory to share between to nlb servers.
I have content inside my App_Data folder . That is config files and other files. I want to publish the App_Data folder which is set up as a virtual Directory inside the website in both servers nlb1 & nlb2 which are pointing to \\191.234.123.111\website storage\App_data which is in other machine -->
Advanced settings for virtual directory
Physical path : \\191.234.123.111\website storage\App_data
Virtual path: /App_Data
All-Star
17652 Points
3510 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Feb 06, 2017 09:56 AM|Chris Zhao|LINK
Hi Jim2401,
Set Alias to App_Data and the physical path to the shared file location
http://docs.sitefinity.com/administration-configure-the-project-s-app_data-folder-to-be-on-a-shared-file-location
Best Regards,
Chris
Member
10 Points
27 Posts
Re: Publish App_Data folder to Virtual directory in Visual Studio 2013
Feb 16, 2017 04:10 PM|Jim2401|LINK
Thanks, Chris . It really helped me and finally got WebDeploy working with cmd line on prod serevr:
C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe
-verb:sync -source:contentPath="C:\a\testteamcity\Demo\WebApp\obj\Release\Package\PackageTmp"
-dest:contentPath='prod.test/deploy',ComputerName="https://XXX:8172/msdeploy.axd?prod.test",UserName='XXX\abc',Password='*****',AuthType='Basic' -allowUntrusted