Category: Development

  • Make IIS 7.5 application pools run as NETWORK SERVICE

    There is a break change in IIS 7.5 on Windows 7 and Windows Server 2008 R2. The default identity for running an application pool is "ApplicationPoolIdentity".  If you have a web application developed against application pools running with NETWORK SERVICE on IIS6/7, it might break after migrated to IIS 7.5 due to default application pool…

  • Mixed mode assembly Error After Upgrading to DotNet 4.0

    After upgrading existing DotNet 2.0 or 3.5 application to DotNet 4.0, you might see following error message Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. To fix this issue, put a config file next to your exe called <exename>.exe.config with…

  • Windows Phone 7 Application Development Get Start

    Getting Start with Windows Phone 7 Application Development Download the tools and emulator from http://developer.windowsphone.com Using the tutorial from the Microsoft Channel9 Learning Center, build your first application.

  • Install PowerShell From Command Line

    To install PowerShell on Windows Server 2008 R2 or Hyper-V Server 2008 R2, following features needs to be installed. NetFx2-ServerCore NetFx3-ServerCore MicrosoftWindowsPowerShell Because Powershell is built on DotNet framework, DotNet 2.0 and 3.5  has to be installed prior to PowerShell installation. To install PowerShell from command line, run following from elevated command prompt DISM.exe /online…

  • Enable DotNet 3.5 from command line

    To enable DotNet 3.5 from command line, run following from elevated command prompt dism.exe /online /enable-feature /featurename:NetFx3

  • Perl Replace String in File

    This code snippet demonstrates how to replace string in file using perl. This perl script takes in an input file, replaces the all string foo with bar. my $file = $ARGV[0]; my $filetmp = "$ARGV[0].tmp"; open (INPUT, "< $file") or die("Unable to open $file"); open (TMP, "> $filetmp") or die("Unable to open $filetmp"); while(<INPUT>) {…

  • Could not load type System.ServiceModel.Activation.HttpModule

    If you install DotNet framework 4.0 on Windows Server 2008 or R2 after enabling IIS,  you might see following error when browse your application site made of ASP.NET 4.0 (or run on ASP.NET 4.0 application pool). Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. Description: An unhandled exception occurred during the execution…

  • Microsoft Training Kits

    The Microsoft Training Kit is free download that contains useful training resources. Here is a list of some latest useful training kits, the training content includes demo, videos, presentations, hands on lab and some code samples. Enjoy it Windows 8 Camp in a Box Web Camps Training Kit Windows 7 Training Kit For Developers SQL…

  • Perl Last Element of Split

    There is an easier way to get last element on a split operation, save split result to an array and use $array[-1] and this will access last element of the arrays. Example $strings=”foo,bar,test”; my @fields = split(/,/, $strings); print $fields[-1] ;  # the last str in $strings

  • Perl Backslash in Regular Expression

    This note is for a trick to use Q and E  to escape characters for regular expression. You will find it very useful when you do string substitution and your pattern contains characters like slashes or backslashes .