Tuesday, January 20, 2009

Problem:

You just received your brand new Vista 64 bit machine and you try to develop an Asp.Net application using IIS 7. The error "is not a valid Win32 application" is displayed.

Solution:

Open a command window and paste this in:

cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1



Google Credits:

http://www.cassidy.dk/blog/sitecore/2008/06/is-not-valid-win32-application.html

http://www.eggheadcafe.com/articles/20050417.asp

Monday, January 19, 2009

To replace text in multiple files in PowerShell:


$localPath = $dirPath
cd $localPath
$files = dir * -Include *.Master
foreach ( $file in $files )
{
$path = $file.fullname
$text = [System.IO.File]::ReadAllText($path)
$new = $text.Replace("vs:Form", "form")
Set-Content $path -Value $new
}