How do I keep folder tree and publish websites in TFS 2010? - visual-studio-2010

I have a visual studio solution that consists of several web applications, windows services and other class libraries. I am in the process of configuring it for continuous integration with TFS 2010.
The default build template puts every binary in the drop folder, and creates a _PublishedWebsites folder in which it publishes every web application. I do not want that because I need to separate the files that belong to one service from the files that belong to the another service.
I have followed the steps in TFS 2010 BUILD SERVER: Can not keep folder tree in the drop location to put each output in its own folder. That works well, but now my web applications are no longer published. The project is compiles and its binaries are placed in a sub-folder inside the drop folder, but it is missing all the other files, like Web.config, aspx, css, etc.
I could probably use two build templates, one for web applications, and the other one for windows services, but I'd rather have a single build template. How can I achieve this?

Why you don't use separate build process for each web application? Creating multiple build processes and multiple build definitions is very easy. You can copy or branch template process and then create a new build definition for each of them.

Related

WebDeployment is not

I am trying to deploy an web application that was created on VB with the .NET Framework 2.0 using the TFS 2017 continuous deploy. It doesn’t have a solution file inside like vbproj or csproj, so I needed to avoid all the suggestions to include extra information on the vbproj.In order to run the MSBuild even locally I need to change in my .sln this tag, so all my compiled code is also there
Debug.AspNetCompiler.TargetPath = "....\PrecompiledWeb\ARB\Debug\"
Unfortunately, I can’t deploy the application using the TFS. So far I tried to deploy it through my Visual Studio project, and is working fine with every option: I tried MSDeploy, Web Deploy Package, and FileSystem, and is working fine from the Visual Studio Publish Option
With that, even my transformation take place.
Now lets say I go to my TFS and I put this parameters on the MSBuild
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsASingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="\\MyServer\Content"
My files are compiled but never stored in my Content folder. No one of them!!! I can’t figure out what is going on here.
From your screenshot, you are using a Web Site project, not a Web Application project. The output structure of a Web Site project in TFS is different from build in VS (you can see a PrecompiledWeb folder in your build source directory on build agent server). Instead of using MSBuild argument, you can consider add tasks below to copy the files you want to publish:
We strongly suggest you switch from Web Site projects to Web Application projects to avoid these issues.

Parameters.xml - what is the best way to include many of them?

We have a couple of environments where we want to deploy our webapp to. We would like to include a range of setparameters.xml files in our project and when we execute the web publishing pipeline (wpp) we want those be copied over to the destionation folder. What would be the additions we need to include in wpp.targets?
We are using Visual Studio 2013 / 2015.
No changes are required in the wpp.targets file. We have 4-7 different SetParameters.[env].xml files for most of our products. We keep this in the root of the web application project.
We use the -setParamFile flag to set the necessary parameter file for the right environment when we execute the *.deploy.cmd file. We use Thoughtworks GO! to trigger the deployment but you can use any release orchestration product or just the commandline.

How Can I Exclude a Visual Studio Project from an Azure Deployment Package?

I'm not sure if Visual Studio 2010 already does this or not with respect to how it packages Azure deployments, but I have a Visual Studio solution which contains 5 projects:
The Azure Service Project
The project for my web role
2 class library projects which
contain the DAL and BLL that my
roles use
And one MS Test project used for
unit and integration testing across
all of these projects
My deployment package right now is roughly 100 mbs, and takes a while to upload. I have some other things I can do to make it smaller, but what I want to know is if there's a way I can make sure that the MS Test project isn't being packaged alongside everything else given that it has the largest footprint. Any suggestions, or is this not actually a problem?
As long as there are no references from your web role, the DAL or BAL projects to the test project, then it shouldn't be included in the package.
If you're worried about it I would first of all double check all of the references in the web role, DAL and BLL projects to make sure that you're not accidentally referencing the test project.
As long as that is OK, I'd then do a publish of the project to disk and then have a poke around in the \bin directory if the cloud project to see what's actually using up all of that space.
Just as stated before is you do not have any references to your test project in your web role you should not worry for having it deployed alongside the rest of your code.
Another thing I would recommed is to just precompile your web site and
add it as another site in your file using a host header for it.
The advantage of that is that you can create a msbuild task to precompiled your site and just upload it.
Also I reposted about a solution for putting your view files in azure storage which will allow you to modify appearance without going thru the republish process.
http://blogs.artinsoft.net/mrojas/archive/2011/05/01/windows-azure-and-websites-in-a-flux.aspx

Team Foundation (TFS 2010) Folder Cloaking - Server Side Alternative?

I have a website project that is consuming user controls from another shared project. I am using a build event to copy the *.ascx files over from the source user control project.
I don't want the ascx files to be checked into TFS source control from the consuming project, only the source project. Is there a way to keep TFS from trying to check in files from a specific folder other then cloaking?
My issue with cloaking is that it's a client side function, which means every developer who takes down the project would have to manually cloak the folder or folders in question themselves. I'd like to be able to setup the solution in such a way as a developer could take the project down from source control without having to manually configure it to accommodate my separate project for shared user controls.
There is an article here: http://devio.wordpress.com/2009/11/05/shared-aspx-and-ascx-files-in-visual-studio-and-tfs/ that seems to address this issue but I think they're setup is different then mine in that I am using a website project and not a web application project. Being that I have no .csproj file there's no way to include or exclude files from my project.
Check out the TFS Power Tools (if you haven't already) http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f, under Team Members > General Settings, you can setup a Worspace Template to cloak as needed.
Not played with it myself, but looks to be the functionality that you need.

Solution items cross several web projects in Visual Studio

I have two web projects, both these projects share client-side JavaScript currently residing as almost identical copies in both projects. I say almost because I'm clearly having versioning problems with these files.
I've managed to put the files in a solution folder and created links to them from my projects and this works when I publish the projects. However, when I run the WebDev server locally these files are not hard file system links? They seem to be maintained within the Visual Studio project as a reference only.
The problem is that the WebDev server will make a request to the presumable valid location of the file but it will not find it there because it doesn't exist as a physical file at that location.
Anyone know how to work around this?
If you use SVN, you could have the files managed as externals. Basically this will allow you to have the shared files maintained in one location, and have an external (physical file) reference to them.
http://svnbook.red-bean.com/en/1.0/ch07s03.html
Dave the Ninja
Here is a post that can help you :
Using Linked Files with Web Application Projects
http://consultingblogs.emc.com/jamesdawson/archive/2008/06/03/using-linked-files-with-web-application-projects.aspx

Resources