Automatic redirection from Http to Https and vise versa using relative urls in

Filed in .Net | ASP.Net Configuration 1 Comment

A very nice contorl/project (recommend by my Chief Architect) for a very common problem which we all face when we need to secure only specific pages. Below is the link.

I applied this in my production environment and it is working perfectly. All related issues are solvable/configurable.

Some useful email exchanges between me and Matt(the guy who made this) are added below as comments.

Let me summarize the steps (If your using Visual Studio 2010)

  1. Install-Package SecuritySwitch from VS > Tool > Extension Manager > Search “SecuritySwitch” install it, more details can be found on
  2. Above step set-up every thing for you for your development environment. (Put some attributes in you web.config, add some dlls etc)
  3. Now you need to specify your secure pages in web.config inside securitySwitch>paths>
  4. These are important attributes mode=”" baseInsecureUri=”" baseSecureUri=”"
  5. For the staging or production deployment please go through with the below comments.

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode

Filed in .Net | ASP.Net Configuration Leave a comment

We have a dotnet web site which is built on framework 4.0 and is running over windows 2008 R2 server.

Today we added an application role to the server and defined framework 3.5 to be installed alongwith that. After doing this we suddenly started receiving the below error:

Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceMode…..

After doing some googling I found the solution which suggests that register the again with the appropriate version so I registered the (using aspnet_regiis -i command in the v4.0 folder of the dotnet framework) and that resolved my problem.

Found the solution at :