TFS generates a publish directory under the build agent working directory:
Z:\TFSBuilds\1\box\CT\Binaries\\_PublishedWebsites
I am supposing that this is where TFS is automatically publishing the site. How can I use it for auto publishing of sites... as Should we refer our IIS website to this directory. What is the purpose of it?
Firstly, the working directory is as the name says, a "working" directory. That is where the build agent downloads the source, perform compiles etc. It also clears the working directory whenever you run the build again so you risk grabbing unfinished artifacts when you try to retrieve from the working directory.
TFS defines a "drop folder" that it will copy the final artifacts to, once the build completes. You can define the drop folder for a build by editing it's build definition:
Right click on the build and choose 'edit build definition.
Select the 'Build Defaults' section.
Tick 'This build copies output files to a drop folder'
Enter an UNC path for the build agent to copy artifacts to (make sure the Build Agent has access to that UNC path!)
Secondly, in regard to _PublishedWebsites. The build agent will create a _PublishedWebsites folder for each Web project it builds as part of its build artifacts (so if you tell it to build a solution with 2 web projects, it'll create [Project name A]\_PublishedWebsites and [Project Name B]\_PublishedWebsites). Inside each _PublishedWebsites folder are the contents to be dropped into an IIS application, same as what you would get by right clicking on a web project and selecting 'Publish'. I normally add a last step in the build workflow to copy the contents of this _PublishedWebsites folder to my desired IIS directory.
This link tells you how to add the copy workflow: TFS 2010: Copy _PublishedWebsites to test server
And here's more on drop folders: http://msdn.microsoft.com/en-us/library/bb778394.aspx
Related
I need to skip a file on the server when I deploy my app. My friend told me that I could use SkipExtraFilesOnServer, but I don't understand how it works.
I have a .txt file that I want to keep unchanged after deploy.
When you publish your Web App using Visual Studio, in the Publish wizard under Settings, expand the "File Publish Options" and uncheck "Remove additional files at destination". If they are static data files your app depends on, then they should really be in the App_Data folder and you can make sure the "Exclude files from the App_Data folder" is checked.. The first option leaves any unrecognized files on the destination.
In the PublishProfile under YourProject >> Properties >> PublishProfiles, you will find a copy of yourPublishProfile.pubxml. The corresponding elements respectively in this file are:
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer> and <ExcludeApp_Data>True</ExcludeApp_Data>
I am publish my website application . I am storing all my data in XML files in App_Data folder and in some other folder too.
The steps i follow are
1) Publish using visual studio 2010 asp.net c#.
2) Then copy my all file from "\Debug\PackageTemp" and paste in "C:\inetpub\wwwroot"
The files in wwwroot are being used my inetmgr and my system now acts as a server.
Am i doing it right ?
One More Question .
If i publish and follow the steps as mentioned above ,then for second time all my data (in XML file)get reseted.
So i wrote a batch file which will keep all my data files in backup and after deploy my website i vl copy my backup files in respectively folder ..but i dont know when to call my batch file .Is there anyway to call these batch file while i am doing my deployment ..
OR
there is any feature provided by microsoft visual studio to keep backup and automatically copy these files or not to modify some files
Once you Publish your solution, try selecting the Publish Method as "File System". Then point the target location to any folder on your system/network and click on the Publish button in the dialog.
Just copy all those files and directories that are created in that location, to either your FTP folder in case of a Web Deployment or to a local/network folder and configure a website from IIS.
I have just started using the Build functionality within TFS and I can't see all my dlls being uploaded to the server. I have tried looking online but have failed to find a solution.
So there is a specific dll that has been added to the bin folder in a ASP.NET application and has been referenced and checked in. After I 'Queue New Build' within Team Explorer, it completes successfully.
So when I run the website on the server, it complains that it can't find that dll. And when I access the server and look into IIS Manager, I can see that the dll I have added is not located in the bin folder.
How do I get this to appear there via TFS build?
I solved the problem by these steps:
Adding the dll file to the bin folder locally.
When viewing the dll in Solution Explorer, second click it and then select Include in Project (this is what I never did).
Second click the References folder and browse to the dll in the bin folder. (not sure if this part was essential, but I did it anyway).
Make sure it builds.
Check into TFS.
View Team Explorer > Builds
Second click the build you want to run, and select Queue New Build, then Queue.
After running successfully, I checked the the _PublishedWebsites folder to see if the bin was included. It was. And then I ran the website on the server and WALLA! It worked.
My web application has two build configurations, Dev and Prod. There is a custom build step that will copy some extra config files to the bin folder, and the files are different depending on the build configuration.
This all works well when I do a build, but when I Publish to a FileSystem, these files are not copied over from my bin folder to the publish destination path. Any ideas how to get around this?
Are you setting the "Copy Local" property to true?
When you publish to the local file system, this will copy the files locally.
This is the error I get:
Error 101 Could not load type
'control'. /Test.vbproj/x.ascx 1 1
WebDeployProject
This is a left over file that was part of the project last week, but one of the developers deleted it from the project. I have to manually delete the file in order to get the WDP to build. Is there a way to tell the WDP to ignore the files that are not part of the project or to see that these files are not part of the project and delete them?
You'll need to use your source control tools to find and remove local files that aren't under source control.
For instance, if you're using TFS, do the following:
Open Source Control Explorer (View -> Other Windows -> Source Control Explorer)
Right-click on the path in TFS that corresponds to your local working copy and select Compare
Use your TFS path as Source Path and your local working copy as Target Path
Under View Options, select "Show items that exist only in target path"
You've now got a list of all the files that exist in your local working copy but aren't in source control. For each file, either delete your local copy or add it to source control.
It could have something do to with the type of web project is it.
If it's a web site, then the compiler will attempt to compile every file in the folder. However, if it's a Web Application Project, then it will only compile those that you've specifically added as part of the project.
If you have recently deleted/removed a file from your project then you need go to Project > "Show all files" and all removed files will apear in your solution explorer. You can delete the file, /x.ascx and rebuild your WDP.
It has nothing to do with the type of Web project: http://amiraryani.wordpress.com/2008/11/06/web-deployment-project-aspparse-could-not-load-type/.
A Web Site itself considers files under its root directory as part of the site.
A Web Application Project itself allows you to customize build actions, etc. on a per-file basis.
A Web Deployment Project, however, will try to include files under the root directory (a la a Web Site), even if the WDP is associated with a WAP. That's why it doesn't matter which kind of Web project it is.
EDIT: To clarify, it would matter what type of Web project you are using if you were trying to Build, Debug, or Publish that project itself instead of using a WDP.