Sponsors

News

Jobping Laurent Kempé MVP JetBrains Academy Member Certified ScrumMaster

Contact

My status

View Laurent Kempé's profile on LinkedIn
XING
twitter
facebook


Xbox 360



Map

Locations of visitors to this page

.NET Dudes

Family

French .NET Dudes

Friends

Jobping

Links

Tech Head Brothers

November 2009 - Posts

VisualSVN and Pending Changes

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:

4146938714_6faf5320fe_o[1] 

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:

4146948196_958c3396c3_o[1]

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

VisualSVN Pending Changes

By the way I also use VisualSVN that I highly recommend ! It is really easy to install and configure on a Windows machine.

Posted: Nov 30 2009, 11:09 AM by lkempe | with no comments
Filed under:
Displaying application version on TeamCity home page

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:

4097914182_2e086aabc1_o[1]

When your software is built it will now display the version:

4097158651_22d00c0ac1_o[1]

Posted: Nov 12 2009, 10:00 AM by lkempe | with no comments
Filed under:
Automating Publish of ClickOnce with TeamCity

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:

  1. Copy Publish.html.ori to Publish.htm
  2. Use FileUpdate of MSBuild Community Tasks to search the 2.0.0.x string and replace it with the version
  1. <!-- Deploy Click Once-->
  2. <Target Name="DeployClickOnce">
  3.   <Message Text="####### Deploy ClickOnce $(Configuration)|$(Platform)  ---------#" />
  4.   <Exec Command="xcopy /E /Y $(ClickOnceSrc)\*.* $(ClickOnceDestination)" />
  5.   <Copy SourceFiles="$(ClickOnceDestination)\Publish.htm.ori" DestinationFiles="$(ClickOnceDestination)\Publish.htm" />
  6.   <FileUpdate
  7.     Files="$(ClickOnceDestination)\Publish.htm"
  8.     Regex="2.0.0.x"
  9.     ReplacementText="$(FullVersion)" />
  10. </Target>

and the FullVersion is defined as this, using TeamCity BUILD_VCS_NUMBER, which is Latest VCS revision:

  1. <Major>2</Major>
  2. <Minor>0</Minor>
  3. <Build>0</Build>
  4. <Revision>$(BUILD_VCS_NUMBER_app_Trunk)</Revision>
  5. <FullVersion>$(Major).$(Minor).$(Build).$(Revision)</FullVersion>  </PropertyGroup>

And now the Publish webpage display the version correctly!

4094558371_70b24140cc_o[1]

Watch Several TeamCity Servers With Windows Tray Notifier

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:
    JetBrains.TrayNotifier.exe /allowMultiple

    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”

4076003432_6c2b8f449f_o[1]

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.

Nice!

Posted: Nov 04 2009, 08:49 PM by lkempe | with no comments
Filed under:
Windows Backup, Xbox 360 media extender and 0x80070002 error

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.

4071003833_d19380d9ab_o[1]

Restarted backup and now it works!

Build multiple ClickOnce deployment packages using MSBuild and Team City

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>

  1. <!-- ClickOnce getting build number from Team City -->
  2. <ApplicationRevision>$(BUILD_VCS_NUMBER_MyApplication_Trunk)</ApplicationRevision>

And now all my ClickOnce packages have the same Application Revision which is better !

Building ClickOnce with TeamCity

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

  1. Copy my whole c:\Program Files\Microsoft SDKs\Windows\v6.0a folder to the server
  2. Created a registry key
    Key: HKEY_LOCAL_MACHINE\Software\Microsoft\GenericBootstrapper\3.5\
    Value: Path
    Type: REG_SZ
    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.

TeamCity migration tip

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.

Update

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.

ClickOnce certificate and TeamCity

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.

4068846824_d9a73b13b8_o[1]

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

> my_TemporaryKey.pfx

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.

Enjoy!

More Posts