IIS 7 Hello World Module Walkthrough
The other day I found out that the Vista SDK includes a compiler. I was very excited to find this out, cause now creating a "Hello World" IIS 7 C++ module only requires one huge install (and two little ones).
Build:
- Install the Vista SDK
- Unzip attached helloworld.zip to \temp\hello
cd "\Program Files\Microsoft SDKs\Windows\v6.0\Bin"
setenv.cmd /debug /x86 /vista
cd \temp\hello
build.bat
Deploy:
cd %windir%\system32\inetsrv
appcmd add backup hellobackup
appcmd install module /name:Helloworld /image:\temp\hello\hello_world.dll
appcmd set config -section:handlers "-+[name='HelloHandler',path='*.hello',verb='*',modules='Helloworld']"
Test:
- Install wfetch
- Set the path field to: /a.hello
- Expected: Hello World
Debug:
- Install the debugger to c:\debuggers (checkout c:\debuggers\debugger.chm index tab for more details on the commands below)
- cmd:
net stop was /y
- cmd:
cd %windir%\system32\inetsrv
- cmd:
c:\debuggers\windbg -2 -g -G w3wp.exe /debug
- debugger: Ctrl-Break
- debugger:
.sympath SRV*c:\localsymbols*http://msdl.microsoft.com/download/symbols
- debugger:
bm hello_world!*execute*
- debugger:
g
- wfetch: F5