Write a global-level IIS HTTP Module in C#

  1. Global-level HTTP Modules are Class Libraries not ASP.NET projects – though a HTTP Module class can be added to a single ASP.NET project.
  2. Open Visual Studio and create a new Windows Class Library project.
    New Project > Class Library
  3. Add a reference to System.Web.dll:
    Reference Manager
  4. Implement the IHTTPModule interface:
  5. Determine which HttpApplication Events you want to respond to:
  6. Install the module into the Global Assembly Cache from your output directory:
  7. Open Internet Information Services (IIS) Manager and select Modules:
    IIS Modules
  8. Click Add Managed Module… in the Modules Actions pane and select your assembly.
  9. Depending on the nature of your HTTP Module, you may want to restart the server from IIS Manager.

Stop Visual Studio from creating PDB folders in your project

If Visual Studio is cluttering your solution with Project Database (PDB) Folders, there are a couple of ways to deal with them:

  1. Change the location of the Symbols Cache:
    In Visual Studio, click the Debug menu, and select “Options and Settings…“. In the dialog, select Symbols under Debugging. Change the location where the folders are created under “Cache symbols in this directory:“. I’ve chosen to keep mine in the Windows Temp folder. The PDB information will still be available but kept out of your solutions, projects, and best of all SVN.
    DebugOptionsSymbols
  2. Create a single PDB file instead of PDB Folders:
    From your project’s properties, select Build, and click the “Advanced…” button at the bottom of the screen. In the dialog, select “pdb-only” from the “Debug Info:” list. This will create a single PDB file and prevent PDB folder from being generated. Developers are still responsible for keeping the PDB file out of SVN.
    AdvancedBuildSettings

 

JavaScript Recipes

I’m writing a book for for Apress. It will be available in early 2014. 

JavaScript Recipes is your go to reference for tackling common and advanced JavaScript tasks. JavaScript is the world’s most popular client ­side scripting language and is gaining popularity on the server. This book takes you from language basics like built­in objects and flow ­control all the way to advanced “Bit Twiddling” optimization techniques, and everything in between. Quickly discover solutions to common problems, best practices you can follow, and everything JavaScript has to offer.

You will learn:

  • Language fundamentals like types, conversions, execution contexts, expressions, operators, statements, and built­-in objects.
  • How to explore and make the most of your script’s host environment and how to create your own JavaScript host using Google’s V8 engine.
  • Employ advanced optimization techniques to create scripts that execute as fast, or faster, than native executables.

JavaScript is a powerful language that developers have used to write 3D games, compilers and even a virtual machine that boots Linux. JavaScript Recipes shows you how to avoid wasting development time and concentrate on developing cutting ­edge applications. You’ll see how much quicker and efficient it is to develop with JavaScript.

ISBN: 9781430261063