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

Optimization of Web Site hosted on IIS 6

The other day I had to re-install my whole server which is hosting Tech Head Brothers. I had also to redo the configuration to have IIS deliver compressed content. I was quite sure to have a post on this but the only thing I could find was “Optimization of a Web Site - Using Content Expiration (IIS 6.0)

So I started from scratch and after some issues I finally managed to have it running. I started uisng the following post from Scott Forsyth, “IIS Compression in IIS6.0” and I took over those steps from his post:

First, before anything else, backup the metabase.  This is done by right-clicking on the server in the IIS snap-in and selecting All Tasks -> Backup/Restore Configuration.  The rest is straight forward.

Create Compression Folder (optional)

The first thing I do is create a folder on the D drive where the static file compression will be cached. You can call it anything you want or leave the default of “%windir%\IIS Temporary Compressed Files” if that works for you. The IUSR_{machinename} will need write permission to the folder. If you use custom anonymous users, make sure to assign the proper user. IIS will still work even if the permissions are wrong but the compression won't work properly. Once running, it's worth double checking Event Viewer to see if any errors are occurring that keep IIS Compression from working.

Enable Compression in IIS

- From the IIS snap-in, right-click on the Web Sites node and click on Properties
- Select the Service tab - Enable Compress application files
- Enable Compress static files
- Change Temporary Directory to the folder that you created above, or leave it at it's default
- Set the max size of the temp folder to something that the hard drive can handle. i.e. 1000. 
- Save and close the Web Site Properties dialog

Note: The temporary compress directory is only used for static pages.  Dynamic pages aren't saved to disk and are recreated every time so there is some CPU overhead used on every page request for dynamic content.

And from the last part I did the following:

  • Open the metabase located at C:\Windows\system32\inetsrv\metabase.xml in Notepad
  • Search for <IIsCompressionScheme

And changed it like this, take care of the carriage return for the HcFileExtensions and HcScriptFileExtensions, it is important:

<IIsCompressionScheme    Location ="/LM/W3SVC/Filters/Compression/deflate"
        HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
        HcCreateFlags="0"
        HcDoDynamicCompression="TRUE"
        HcDoOnDemandCompression="TRUE"
        HcDoStaticCompression="TRUE"
        HcDynamicCompressionLevel="9"
       HcFileExtensions="css
            htm
            html
            js
            txt"
        HcOnDemandCompLevel="9"
        HcPriority="1"
        HcScriptFileExtensions="asp
            aspx
            axd"
    >
</IIsCompressionScheme>
<IIsCompressionScheme    Location ="/LM/W3SVC/Filters/Compression/gzip"
        HcCompressionDll="%windir%\system32\inetsrv\gzip.dll"
        HcCreateFlags="1"
        HcDoDynamicCompression="TRUE"
        HcDoOnDemandCompression="TRUE"
        HcDoStaticCompression="TRUE"
        HcDynamicCompressionLevel="9"
       HcFileExtensions="css
            htm
            html
            js"
        HcOnDemandCompLevel="9"
        HcPriority="2"
       HcScriptFileExtensions="asp
            aspx
            axd"
    >

And then as I explained in the post “Optimization of a Web Site - Using Content Expiration (IIS 6.0)” I then reconfigured the content expiration "Using Content Expiration (IIS 6.0)".

Posted: Jan 03 2010, 11:33 AM by lkempe | with 1 comment(s)
Filed under:
TeamCity 5.0 '​Failed to collect changes error' issue

Tonight I was facing an issue with TeamCity 5.0 plugin in Visual Studio 2008.

I was getting the error message '​Failed to collect changes error' in the new Local changes window.

Searching on the bug tracking tool of JetBrains for TeamCity I found this issue "TW-10474 I can not make VS addin recollect changes after recieveing '​Failed to collect changes error'

Has this issue breaks my way to work with pre-tested build I decided to search for a solution because I cannot work without this now!

So following the instruction "Logging in TeamCity Visual Studio plugin" : Reporting Issues

Looking at the produced logs I found this:

9:28:24 PM.987: Thread:31: svn.exe info "xml" "non-interactive" "p:\@projects\_handsup\portal"
9:28:24 PM.987: Thread:31: Failed to execute svn. code 1, error svn: Try 'svn help' for more info svn: Syntax error parsing revision 'projects\_handsup\portal' , output <?xml version="1.0"?> <info>
9:28:24 PM.991: Thread:31: EXCEPTION: svn: Try 'svn help' for more info
svn: Syntax error parsing revision 'projects\_handsup\portal'.
Svn has exited with code '1'.
SvnInfoUuidCommand failed

I tried then the svn command from the command prompt and got the same error!

I finally renamed the path to my project from p:\@projects\_handsup\portal to p:\projects\_handsup\portal

And now it works again! So forget strange characters in your path!

TeamCity 5.0 Released!

JetBrains just published TeamCity 5.

The wait is over, ladies and gentlemen! The release build is baked, tested, and put on the shelf. Tastes good, so go and grab it now!

Let us write down a short summary of what was accomplished since the TeamCity 4.5 release.

First of all, here’s the list of most noteworthy features:

  • Support for Amazon EC2: Take advantage of cloud computing with TeamCity by putting build agents on Amazon EC2 cloud with on-demand image starting and on-idle stopping.
  • Issue tracker integration with JetBrains YouTrack, JIRA and Bugzilla - out of the box, plus an API for the integration plugins for other systems.
  • Maven support improvements, including simplified build configuration creation from POM file, and build triggering on Maven artifacts change.
  • Build configuration templates for eliminating redundancy in build configurations settings.
  • Project archiving for putting no-longer-active projects out of sight.
  • Command line tool for running Personal builds on server without IDE integration.
  • Backup & Restore were added to simplify TeamCity maintenance. Also, migration tool was re-implemented.

Other improvements:

  • Now you can view the status of a change across all build configurations on a single page.
  • Failure responsibility feature has been advanced to cover not only builds, but also individual test failures.
  • Various actions performed by TeamCity users are now stored in the Audit log, which can be browsed from the web UI.
  • Code coverage analysis has been significantly improved for both Java (based on IntelliJ IDEA coverage engine) and .NET (support for NCover and PartCover).
  • And many more

New and improved integrations:

  • Git & Mercurial support are now bundled with TeamCity.
  • Remote Run now works for Git from IntelliJ IDEA & Eclipse.
  • New support for Cucumber, Shoulda, Test-Spec in Rake runner.
  • TeamCity IntelliJ IDEA plugin now works with IntelliJ IDEA Community Edition and RubyMine 2.0.

Of course, this is not an exhaustive list, so check What’s New to get a full overview of new features and improvements.

As always, TeamCity 5.0 Professional is available for FREE for all small- and middle-sized development teams and can be downloaded at http://www.jetbrains.com/teamcity/download.

TeamCity 5.0 Enterprise is available for a 60-day free trial download at http://www.jetbrains.com/teamcity/download.

New customers can purchase TeamCity 5.0 online at http://www.jetbrains.com/teamcity/buy/.

Existing customers can upgrade to version 5.0 after purchasing a 1-year subscription for software updates at http://www.jetbrains.com/teamcity/buy/.

TeamCity licenses bought after October 1, 2009, receive a 1-year subscription for software updates for free, and therefore will work fine with TeamCity version 5.0. If you have such licenses, you will soon receive an e-mail with the new keys and certificates.

Build safe!

The JetBrains TeamCity Team

Posted: Dec 03 2009, 10:03 PM by lkempe | with no comments
Filed under:
ProjectReference with Condition in your MSBuild project files

Since some time I have the current scenario where I need to have conditional reference in a project. Basically the application must reference an assembly in one case in other it should reference another one. This was working correctly from an MSBuild point of view as the first implemented solution let me compile and run the application on my development machine and it was also working for our TeamCity build server. So everything was fine in this perfect word expect one thing!

The issue was the following; Visual Studio was showing two references of the ‘same assembly’ with different path. Not really an issue you would say because the correct one was used at compile time and at run time in all configurations. So the issue was that this had an impact of ReSharper. And this is I cannot accept because it affect my productivity.

So the other day I had a discussion with Ilya of JetBrains which gave me some idea but also told me that ReSharper reads project structure out of Visual Studio and that it doesn't provide lots of info, e.g. conditions on references. So this is why seeing two reference of the ‘same assembly’ was not a problem on Visual Studio itself and on the build server but was an issue to ReSharper because it was seeing two same reference, same namespace, same classes…

Today I had some time free and decided to see where I can come with this issue. And I found a solution.

My first solution, which had the explained issue was the same as the one on this post “Don't be afraid of your csproj-Files (III): We have a condition”, so having a Condition on the ItemGroup.

The solution I came to is to bring the Condition to one upper level than the ItemGroup, so I used Choose like this:

  1. <Choose>
  2.   <When Condition=" '$(Configuration)' == 'client1DeployClickOnce' ">
  3.     <ItemGroup>
  4.         <ProjectReferenceInclude="..\client1\app.Controls\app.Controls.csproj">
  5.         <Project>{A7714633-66D7-4099-A255-5A911DB7BED8}</Project>
  6.         <Name>app.Controls %28Sources\client1\app.Controls%29</Name>
  7.       </ProjectReference>
  8.     </ItemGroup>
  9.   </When>
  10.   <Otherwise>
  11.     <ItemGroup>
  12.       <ProjectReference Include="..\app.Controls\app.Controls.csproj">
  13.         <Project>{2E6D4065-E042-44B9-A569-FA1C36F1BDCE}</Project>
  14.         <Name>app.Controls %28Sources\app.Controls%29</Name>
  15.       </ProjectReference>
  16.     </ItemGroup>
  17.   </Otherwise>
  18. </Choose>

Reloading the project I had the surprise to see only one reference and that ReSharper was working again correctly!

For sure the build on TeamCity is also working perfectly.

MVVM Light Toolkit V3 Alpha 3 for WPF4/SL4

Laurent Bugnion just published MVVM Light Toolkit V3 Alpha 3 which support WPF 4 and Silverlight 4!

I published, yesterday a short post in French on my Tech Head Brothers portal about Silverlight 4 Beta, Drop Target et MVVM which shows the usage of this new version of EventToCommand combined with Silverlight 4 Drop Target.

Here is the post of Laurent

4149123651_4bb720be74_o[1] I just published the latest alpha version of the MVVM Light Toolkit. I will post more about the new features in this alpha version, but the most exciting is probably that with this release, the MVVM Light Toolkit works in Windows Presentation Foundation 4 and in Silverlight 4 (in Visual Studio 2010).

There is no automatic installer for this version yet, but I wrote a page describing how to install manually (it is as easy as unzipping a few files). All the features are also available for Visual Studio 2008 as usual.

The source code was also updated on the Codeplex website.

More documentation will follow soon so stay tuned. In the mean time, have fun with MVVM in WPF4/SL4!

Posted: Dec 01 2009, 09:50 AM by lkempe | with 1 comment(s)
Filed under: ,
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!

More Posts « Previous page - Next page »