Galin Iliev's blog

Software Architecture & Development

Run scheduled tasks in managed code

Easy thing, isn't it? Just have to create a database that will have all tasks with relevant information about them and then create a service which will pull them and execute the tasks when needed. Not so hard! As making a wheel :) Just bend a thin wood!

Alternatively you might consider using Windows Task Scheduler.

Bart De Smet wrote an article "Calling the Task Scheduler in Windows Vista (and Windows Server 2008) from managed code"

Hope this helps :)

Data Mining with MS SQL Server


Rafal Lukawiecki
A few weeks ago I attended to a very nice seminar organized by Microsoft Bulgaria about Data Mining. We enjoyed a full day with leading world-class strategic consultant Rafal Lukawiecki. It was a nice catch-up and deep dive into Data Mining and Business Intelligence- BI. According Rafal Data Mining will be very fast-growing area in next 5-10 years.
This seminar will be recorded in May 2008 on MS Technet


Here is a video talking about it:


Interested?! Here is an article how to start Data Mining with SQL 2005 and MS Office 2007.

IIS7 Administration and Customization talk

My talk yesterday went well and I think people found it interesting so I've decided to post slides and demo as well as some useful links

From presentation:

  • Slides - PowerPoint 2007 - (2.4 MB)
  • Demo - VS 2008 project (961 KB)

Some resources:

IIS7 talk @ SofiaDev UG

I am giving a talk this Thursday in front of SofiaDev .NET User group at local Microsoft office at 18:30 local time.

In the presentation I will show:

  1. New tools in IIS7 as well as new administration options
  2. New tracing and diagnostics options
  3. New integration pipeline
  4. Deep example that:
    • use custom IIS module written in C#
    • extend IIS configuration schema
    • extend IIS Manager by adding UI component

If this sounds interesting to you and you want to attend write to branimir _ at _ sofiadev dot org

See you there!

SQL 2005 Database mirroring

I had interesting case last week - I had to setup SQL 2005 database mirror. First it sounded as piece of cake - I had to follow steps and recommendations as described in SQL Server Books Online (and here). My goal was to setup DB mirror of type High safety with automatic failover (synchronous).

I had to prepare SQL Instances as:

  1. Create a user (called SqlService in my case) with same password on all machines that will participate in the mirror. Give it enough rights to it. (I put it in Administrators group and denied local login. Later I set more granular security to it)
  2. Setup instances to run in this user context
  3. Set trace flag 1400 as startup parameter to SQL instance


Then I followed How to: Prepare a Mirror Database for Mirroring (Transact-SQL) and when it came to setup DB Mirror it was created... But although I had witness server I was unable to test automatic failover. More precisely I set a connection string of type (

"Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;"

) to a simple web application but when I stopped the instance that hold Principal database the mirror database didn't became principal as expected.

Note: This test was done on SQL 2005 Standard Edition with SP2 on Windows 2003 Standard with the latest updates.

I decided to test this on SQL 2005 Standard (with no SP2) in Win2003. And it worked. I applied SP2 then and I as able to setup DB mirroring again and everything worked as expected - even automatic failover.

Bottom line: Somehow SQL 2005 SP2 break DB mirroring if installed right after SQL Server installation. This was my experience and I if someone has another experience with this I would be grateful if we can discuss here

Useful links:

Hope this helps!

How to enable IIS7 Integrated Pipeline mode

IIS7 has been made alive with Windows Vista (full server release will be with Windows Server 2008) and offers many new features. You can read about them at One of the most exciting features was option to extend IIS using ASP.NET and managed code or so called to "plug into integrated pipeline mode".

So far I was able to run ASP.NET sites using application Classic .NET App Pool. But so far I wasn't able to utilize Integrated pipeline mode.

By setting Managed pipeline mode to Integrated causes my app stop working with terrible error.

Although the message in event log I wasn't able to find a solution although good message:

A request mapped to aspnet_isapi.dll was made within an application pool running in Integrated .NET mode. Aspnet_isapi.dll can only be used when running in Classic .NET mode. Please either specify preCondition="ISAPImode" on the handler mapping to make it run only in application pools running in Classic .NET mode, or move the application to another application pool running in Classic .NET mode in order to use this handler mapping.

Well... the error is in aspnet_isapi.dll. So let's remove ISAPI related modules from modules section

After this operation I got Error 500

HTTP Error 500.0 - Internal Server Error
Description: Handler "AboMapperCustom-76525" has a bad module "IsapiModule" in its module list

So the next step is to remove all Handler Mappings that are mapped to IsapiFilter

And ... voila.. this was it...

Hope you'll find this helpful.