ASP.NET Tracing

Created 23 July 2004 00:00
If you want to quickly create trace files (say you want to get an average load time for your page over 10 loads) you can use the .net tracing view trace results. There are two ways of doing this:


In the page tag on your .aspx file, add the Trace="True" attribute. This will spew out all trace information to your web page.

Using an axd file

Add this to your web config:


You can then access the trace output from the web browser e.g. http://localhost/mysite/trace.axd. If you use this method, be sure to remove the Trace attribute from your page tag in the .aspx file if you want the page's tracing to appear. For all pages you do not want traced, set Trace="False" and they will not output tracing or be logged in the Trace.axd file.

.NET Policy redirects

Created 29 July 2004 00:00
Sometimes you may want calls to an older version of a component in the GAC to be diverted to a newer version of the component.

In order to do this, you need to create a policy redirect file and drop this into the GAC. The following must be done (the example is for an assembly named My.Assembly:

1. Create an XML file containing redirect information

  <?xml version="1.0" encoding="utf-8" ?>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <assemblyIdentity name="My.Assembly" publicKeyToken="17374ea5a1072ad8" />
          <bindingRedirect oldVersion="" newVersion="" />
          <bindingRedirect oldVersion="" newVersion="" />
          <bindingRedirect oldVersion="" newVersion="" />

In this example, the XML file is called "policy.1.0.My.Assembly.xml".

2. Create the policy redirect DLL

Use the Assembly Linker tool to create the policy redirect dll:

al /link:policy.1.0.My.Assembly.xml /out:policy.1.0.My.Assembly.dll /keyfile:"C:DevKeyFilessgKey.snk" /version:

3. Add redirect to the GAC

Step 2 should have created a dll file which can then be dragged and dropped in the GAC (usually located at C:WinNTassembly.

CSS Opacity

Created 29 July 2004 00:00

The following class should be applied to an element to make it opaque:

.opaque {
	opacity: .5;
	filter: alpha(opacity=50);
	-moz-opacity: .5;

- opacity is for Safari
- filter is for IE
- -moz-opacity is for Mozilla

This specifies an opacity of 50% i.e. semi-transparent where 100 is not transparent and 0 is completely transparent. Note that the width OR height of the opaque element needs to be specified for opacity to work in IE.