Ayende @ Rahien

Unnatural acts on source code

NH Prof new feature: Filter static files

One of the most annoying things about doing the TekPub episodes is finding the right session, because NH Prof will detect any session opening. This means that it usually looks like this:

image

Which also means that it is pretty hard to figure out. I got annoyed enough with that to add a specific filter to filter all of those in one shot (you could already do it, but it meant creating several filters):

image

image

Which results in a much better experience:

image

Comments

Simon
12/10/2009 10:18 AM by
Simon

Couldn't you have just used the 'sessions with statements' filter? Or am I missing something here...

Ayende Rahien
12/10/2009 10:28 AM by
Ayende Rahien

Simon,

Yes... and now you make me feel stupid :-)

Although, you actually do sometimes want to see empty sessions created from other places

Simon
12/10/2009 10:38 AM by
Simon

Sorry! :-)

Always useful to have more filters anyway!

Rafal
12/10/2009 11:02 AM by
Rafal

which leads to a question why static file requests create sessions at all?

Ayende Rahien
12/10/2009 11:41 AM by
Ayende Rahien

Rafal,

This is pretty common in apps that are developed on Cassini and then deployed to IIS

On IIS, it will handle static files directly, but cassini make them go through the ASP.Net pipeline.

liviu
12/10/2009 11:44 AM by
liviu

Ok,

ASP.NET pipeline, but why do somebody want to open a session directly and not wrap it in something lazy?

Mark Nijhof
12/10/2009 12:05 PM by
Mark Nijhof

Pain Driven Development, Nice!

Joshua Flanagan
12/10/2009 01:29 PM by
Joshua Flanagan

I can understand that you might sometimes want to see sessions listed if there are 0 statements. How about automatically "grey out" (or visually de-emphasize somehow) sessions with 0 statements? This would be in addition to your static file filter.

Dmitry
12/10/2009 02:01 PM by
Dmitry

IIS7 integrated mode will make static files go through the ASP pipeline as well.

In my opinion, the right fix would be either to assign static handlers to css, js, gif, jpg... files. An alternative is to create a session inside a controller and only dispose it through a module if you want to take advantage of security, etc.

Comments have been closed on this topic.