TFS 2010: Copy _PublishedWebsites to test server - deployment

I've seen similar questions and answers but found them not really what I want.
I have a large solution with several web projects in it. All the web projects share some common code so they are all part of the same solution (there is a common project that is referenced by all of them).
I've been running on Team Foundation Server 2008 and we are upgrading to TFS 2010 to be ready for our move to visual studio 2010 and .net 4.0.
I've got the build working with a 2010 build by creating a new build because we only had one customization I'm trying to reproduce.
Once the build is done I have the files dumped at
\\SERVER\tfsdump\devel2010 build\devel2010 build_20101008.3\_PublishedWebsites
by using the dump folder option but the build location is
C:\Builds\1\Web Applications\devel2010 build\Binaries\_PublishedWebsites
All I want to do is after the build is finished I want to copy _PublishedWebsites\SiteA to \ServerA\ShareA
and copy _PublishedWebsites\SiteB to \ServerB\ShareB
Because there is only one build agent all I need is to call a batch file to run the copy but for easy of use for my developers I need this batch file to be called after every build. Is this possible or is there a better solution?
To make things harder the site is still a 2008 project and it is requested that it stays that way until we can fully test it under VS 2010.

Use a CopyDirectory build activity, set Source property equal to BuildDetail.DropLocation + "\_PublishedWebsites\SiteA" and set Destination property to your desired location. I have put this activity as the last activity in build process and it works properly.

Taking a cue from Afshar's answer, for people directly editing XAML template file, create a new sequence after copy to the Drop location is successful:
DisplayName="Something" Source="[BuildDetail.DropLocation + "_PublishedWebsites\SiteA " ]" />
The quotes inside should be written as &quot and semicolon.

Related

How to deploy an Office VSTO add-in using Visual Studio 2017

I've created an Outlook add-in, debugged and works fine. I want to be able to package it up for distribution. This is for a very limited audience 5-10 people. What are the steps to doing so?
I tried Build | Publish which appears to work (using options of local filename and CDROM install location), but creates a massive 1.5MB setup.exe file and when it is executed, takes forever (it appears trying to contact some remote server and times out and pops an error, although the add-in appears to be registered).
Looking online, I found references to creating a SetupProject or using InstallShield Limited addition, but none of those appear to apply to Visual Studio 2017.
I'd be happy if I could just provide my DLL and a .reg file -- this is for a small set of 5-10 power users.
What is the simplest way to deploy this add-in?
The easiest way is Build | Publish. Just disable any online activities if you don't want it. You can do that in Project -> Settings -> Publish. Check your "Updates" settings for example.
You can download a Visual Studio project type from here:
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects
This will allow you to deploy the package, but it's somewhat buggy in my opinion. Also, the link above does not have any documentation. You have to go to another page for that and the answer is buried in the comments:
https://msdn.microsoft.com/en-us/library/ybshs20f(v=vs.90).aspx
The ClickOnce has worked more consistently for us, however. Just right-click and select Publish on the Project.
It is a long ways off from the old InstallShield LE process, which allowed you to customize the entire process including images, click-through licensing, etc.
But the InstallShield LE had it's own set of issues, and seems to have been all but abandoned.
It may be worth looking at other 3rd-party tools like WiX (http://wixtoolset.org/) to get things installed correctly, or even manually writing your own installer to get things put where they need to be.

Incremental Build with MSBuild.exe

I'm building a Visual Studio 2010 solution through Python with a call to subprocess. When called directly from the command line it takes devenv.com ~15 seconds to start. But when called from Python this jumps up to ~1.5 minutes.
Naturally I'm hoping to remove that dead time from our build. So I decided to test out MSBuild.exe (from .NET 4). It looks like MSBuild.exe runs instantly. But... it seems to do a full build every time and not an incremental.
The command I'm using is
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "C:\path\to\my\project.sln" /target:build /maxcpucount:8 /property:Configuration=Release
It seems like this should support an incremental build. But I've seen posts online indicating that msbuild may not be able to support a incremental build like this.
Is this possible? If so what am I doing wrong?
Update:
I've read into this a bit more. Based on
http://msdn.microsoft.com/en-us/library/ms171483.aspx
and
http://www.digitallycreated.net/Blog/67/incremental-builds-in-msbuild-and-how-to-avoid-breaking-them
It seems like I need the Input and Output properties set in my .vcxproj files. Checking out my files these are indeed missing.
When would they be generated? Most my .vcxproj files were converted over from Visual Studio 2008. But I also generated a new project which is missing the Input and Output properties as well.
Does VS2010 not create projects with these properties?
Update: We've since upgrade to VS 2013. Now msbuild supports incremental builds. Never got to the bottom of the VS 2010 issue.
I think that fact that Incremental builds are not supported is a false Statement from according to official sources,Managed Incremental Build this feature and was included in VS2010 SP1
We first introduced the managed incremental build feature in VS2008.
In VS2010, we were not able to re-implement the managed incremental
build feature with the build system moving to MSBuild. We received
strong customer requests for this feature. As a result, we
re-implemented this feature and it is included in VS2010 SP1.
Other Solutions I found on Web
Projects should build incrementally already (just make sure that you
do Build instead of Rebuild). The best way to check if incremental
building works is to run the build from the command line. The second
time you build it should take almost no time.
If things are still getting rebuilt, then perhaps you've modified
your projects in some way that's messing up with the build order.
Looking at the build logs (via the /v option) can help you poinpoint
what's going on.
Other reason which can cause problems with the incremental build is GenerateResource.TrackFileAccess PropertyThis API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Gets or sets a switch that specifies whether we should be tracking file access patterns.

oledb32.dll cannot improt ado.net while creating setup file

iam creating setup file in ado.net but whenever i build my project it is give me 'oledb32.dll' should be excluded because its source file 'C:\Program Files\Common Files\System\Ole DB\oledb32.dll' is under Windows System File Protection error so that's why i download in net and try to import that dll in my project but this file cannot import detected dependencies folder ..oledb32.dll file is important for show patient details in excel format so can you all expert give me any suggestion or advice
I ran into this issue as well and couldn't find a concrete answer until now.
I'm using a development box, checking in code via SVN, and running CruiseControl.NET to execute devenv.exe to automatically build the project (I don't use MSBuild because Microsoft hasn't implemented a solution for building Setup projects yet, and I assume this is what you are also using). The setup project would build fine on the dev box but on the build server it kept coming up with that same error.
The MSDN explanation can be found here, it's not very descriptive, but that's basically what needs to be done. The more concrete answer can be found here. Basically you have to open up VS on your build server and go in and exclude oledb32.dll (and any other problem files) and voila it finally builds and creates the MSI file! Hope this was helpful for you.

Creating single installer for a multiple MSI's?

I have three different MSI's created to deploy my project. My end result is to run a single exe that will call the rest three MSI's, with the current running installation description or name. As same as we see while Visual Studio Installation.
I have tried WIX but didn't come up with anything. Please guide.
Environment - Visual Studio 2008 / 2010 with Win 7
You're looking for a bootstrapper (sometimes called a chainer). There are many available, including open-source ones like DotNetInstaller and WiX's Burn.
You could create one MSI and combine all you project's primary outputs. If you need to separate them just add a folder for each project's primary outputs.

Cannot deploy web.testing.config to the build server

I am learning TFS 2010 from scratch and no doubt making every mistake in the book.
I have created a web.testing.config for my build to the test server.
In my build process I click the plus sign for "Items to Build" in "1. Required" and I specify "Any CPU | Testing".
The build clean compiles but ... I still seem to be using the web.config file I use in development rather than the one I want in testing.
The first line in web.testing.config is
This should ensure that any differences in this file are implemented.
So I am not sure I am configuring the build properly, or if the web.testing.config is set properly.
What you are looking for is a feature called web.config transforms, and it works slightly differently.
In Visual Studio right click on web.config and choose option Create Tranforms -- if you have not done this already.
Read samples on using tranform syntax, the link is in the web..config created for you. You will need it.
In TFS team build, create a separate step in your build template to build deployment package. The command is in this thread. This will create a deployment package -- a file with .zip extension.
To deploy the package, use WebDeploy tool. It has both UI and command line if you want to make it completely automated.