November 2009 - Posts
I am using and enjoying for some time now VisualSVN plugin in Visual Studio 2008. I just discovered a nice feature that is not part of the normal menu but that you can easily add to; the pending changes window:
It let’s you quickly see the files that you have modified since your last commit, and double click to open those files.
Then you can use the normal shortcut VisualSVN.NextDifference, Ctrl+Shift+Down Arrow or VisualSVN.PreviousDifference, Ctrl+Shift+Up Arrow to navigate the changes into that file that you just opened:
Notice the yellow visual helper on the left !
To have access to the Pending Changes window in Visual Studio 2008, just click on the menu Tools / Customize and then select VisualSVN in Categories, then search for Pending Changes in Commands and drag it to the VisualSVN menu
By the way I also use VisualSVN that I highly recommend ! It is really easy to install and configure on a Windows machine.
I wanted today to display the application version in front of our builds, something I already did on the past but never with the VCS version.
In fact I used the same BUILD_VCS_NUMBER_<simplified VCS root name> that I described here: Build multiple ClickOnce deployment packages using MSBuild and Team City
Go in the General Settings of your build and adapt as following:
When your software is built it will now display the version:
The other day I published different posts about the way I automated our build process at Innoveo Solutions to generate different ClickOnce setup using TeamCity:
Build multiple ClickOnce deployment packages using MSBuild and Team City
Building ClickOnce with TeamCity
ClickOnce certificate and TeamCity
Build ClickOnce deployment packages using MSBuild and Team City
Yesterday I was asked to solve one minor issue. At ClickOnce publishing time the publish.htm file was not generated so the ClickOnce version number on the web page wasn’t shown. The publish.htm file is a static file on the targeted deploy directory and IIS uses that file. The file contains a hard coded version 2.0.0.x.
So from a user perspective it was difficult to know if there were a new version. So I was asked to show the correct version.
I knew from past research a way to handle this from the following post: How To: Generate publish.htm with MSBuild
But I went to a more pragmatic solution, as I already had the MSBuild Community Tasks.
I made a copy of Publish.htm to Publish.htm.ori on each targeted deploy directory.
Then I modified my MSBuild script to do the following:
- Copy Publish.html.ori to Publish.htm
- Use FileUpdate of MSBuild Community Tasks to search the 2.0.0.x string and replace it with the version
- <!-- Deploy Click Once-->
- <Target Name="DeployClickOnce">
- <Message Text="####### Deploy ClickOnce $(Configuration)|$(Platform) ---------#" />
- <Exec Command="xcopy /E /Y $(ClickOnceSrc)\*.* $(ClickOnceDestination)" />
- <Copy SourceFiles="$(ClickOnceDestination)\Publish.htm.ori" DestinationFiles="$(ClickOnceDestination)\Publish.htm" />
- ReplacementText="$(FullVersion)" />
and the FullVersion is defined as this, using TeamCity BUILD_VCS_NUMBER, which is Latest VCS revision:
- <FullVersion>$(Major).$(Minor).$(Build).$(Revision)</FullVersion> </PropertyGroup>
And now the Publish webpage display the version correctly!
Browsing TeamCity documentation this evening I discovered that it is possible to Watch Several TeamCity Servers With Windows Tray Notifier
TeamCity Tray Notifier is used normally to watch builds and receive notifications from a single TeamCity server.
In situations, when you have more than one TeamCity server, and want to monitor them with Windows Tray Notifier simultaneously, you need to start a separate instance of Tray Notifier for each of the servers from the command line with the /allowMultiple option:
- navigate to TeamCity Tray notifier installation folder (by default, it's C:\Program Files\JetBrains\TeamCity and run the command:
Optionally, for each of the Tray Notifier instances you can specify explicitly the URL of the the server to connect to with the /server option. Otherwise, for each further tray notifier instance you will need to log out and change server's URL via UI.
JetBrains.TrayNotifier.exe /allowMultiple /server:http://myTeamCityServer
See also details in the issue tracker.
So now I am able to have two TeamCity Tray notifier open:
What I also like is to be able to start programs by typing the Windows key and then some text, here for example “te”
To achieve this I created three shortcuts with the different servers configuration and then I placed the shortcuts in my folder C:\Users\Laurent\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu in which it is indexed.
Yesterday I bought a new Western Digital external hard drive of 1TB for 109CHF, incredible how cheap it is now.
Then I configured my Windows 7 backup to use this new hard drive, very easy and the backup in less than 2 minutes.
At the end the backup failed because of drive having errors, then after a Error-checking everything was fine.
So I restarted the backup and got again an error:
Backup encountered a problem while backing up file C:\Users\Mcx1-xx-PC\Contacts. Error:(The system cannot find the file specified. (0x80070002))
Backup encountered a problem while backing up file C:\Users\Mcx1-xx-PC\Searches. Error:(The system cannot find the file specified. (0x80070002))
Backup encountered a problem while backing up file C:\Users\Mcx2-xx-PC\Contacts. Error:(The system cannot find the file specified. (0x80070002))
Backup encountered a problem while backing up file C:\Users\Mcx2-xx-PC\Searches. Error:(The system cannot find the file specified. (0x80070002))
Searching on the Internet I found a forum post with the following solution:
This is a known issue with Media center users. For such users, Windows does not create "Contacts" and "Searches" directories which Windows backup expect to be present. As a workaround, please do the following:
1. Launch Change backup settings.
2. Choose the same backup target and proceed to next page.
3. Select "Let me choose".
4. Expand the user Mcx1-NEO node in the treeview. Expand "Additional locations".
5. Exclude the Contacts and Searches directories for the user.
6. Proceed with configuration and save settings.
Restarted backup and now it works!
The other day I posted about Build ClickOnce deployment packages using MSBuild and Team City, and there were something that I didn’t liked in my way of doing it.
I have multiple ClickOnce deployment packages created using TeamCity and MSBuild but each ClickOnce packages have their own Application Revision due to the usage of TeamCity BUILD_NUMBER server build property.
So I changed to use TeamCity BUILD_VCS_NUMBER_<simplified VCS root name>
- <!-- ClickOnce getting build number from Team City -->
And now all my ClickOnce packages have the same Application Revision which is better !
Migrating our TeamCity server today I got the following error on the new server:
error MSB3147: Could not find required file 'setup.bin' in …
I for sure fixed that on the older server, and the fix was to have the SDK on the build server. The issue is that I don’t want to install Visual Studio to do that, so here is how I achieved it
- Copy my whole c:\Program Files\Microsoft SDKs\Windows\v6.0a folder to the server
- Created a registry key
Data: C:\Program Files\Microsoft SDKs\Windows\v6.0a\Bootstrapper\
Then the error was gone and I had my build server ready again to build ClickOnce setup.
Today I am migrating a TeamCity installation from an old server to a new server and discovered that it is really easy to do that!
First I fully re-installed TeamCity using the Windows Setup that JetBrains delivered on the new server.
Then I stopped the old and new instances and transferred the folder .BuildServer from the old server to the new server.
Restarted the new instance and got all my settings from the old instance on the new instance (projects, users…)
This saved my day! and lots of work! Thank you JetBrains for this great tool.
If you set on the original server the Server URL, don’t forget to update it to the new Server URL. This can be done through the Administration > Server Configuration page.
To be able to run a build on TeamCity of a Visual Studio solution containing a ClickOnce manifest which needs to be signed, you will need to add the certificate to the Windows account on which TeamCity services runs.
TeamCity run under Local System account per default.
So you need to add the certificate to this account! But how do you do that?
You will need a tool from SysInternals called PsExec, then using PsExec:
> Psexec.exe -i -s cmd.exe
you will have ran a command prompt on your system in the Local System Account (LSA).
Using that new command prompt, cd to the folder containing your certificate and start it
Then you will face the Certificate Import Wizard in which you click Next > Next > Type the password > Next.
Your certificate is installed now for Local System Account (LSA), and your build should work now.