ReBuildAll Blog
Thoughts (mostly) on .NET development

Top 25 Most Dangerous Programming Errors   (Tips & Tricks)   
Many have probably heard about cross-site scripting or SQL injection and other common pitfalls when developing applications. There is a nice list of the top 25 most dangerous errors one can "create" during coding.

The list was compiled by many organizations and companies, and contains not just the errors themselves but also prevention and mitigations guidelines. Interesting read for anyone concerned about the security of their code.

2010 CWE/SANS Top 25 Most Dangerous Programming Errors

Global Assembly Cache in .NET 4.0   (Framework)   
I was looking for assemblies in the GAC for .NET 4.0, and I just could not find them. As it turns out, I was looking in the wrong place. The usual C:\WINDOWS\assembly folder does not help any longer: it only lists DLLs from prior versions of the .NET Framework.

That is just sad. It was very convenient to install and uninstall assemblies from the GAC by dragging them to this folder in Explorer, or right clicking and choosing uninstall. You did not need gacutil.exe or MSI files to perform such an operation. This was all made possible by a shell extension, shfusion.dll that was included with .NET 2.0 (and so worked for 2.0, 3.0, 3.5)

Now, shfusion.dll is discontinued - no longer shipped with .NET 4.0. So how can you manipulate the GAC?

You can still use the gacutil.exe -l, but that is only included with the SDK. And you need to run it from the Visual Studio Command Prompt, or make sure you know the path for it.

Or you can build MSI files.

For .NET 4.0, the actual folder is located at: C:\WINDOWS\Microsoft.NET\assembly

But there is no magic any longer: it is just a regular folder. In fact, if you have ever visited the old assembly folder from the command prompt, you will feel right at home - you don't see the assemblies in a unified view, rather the raw folders that they are stored in. Separate folders for x86 and x64 architecture (native images) and MSIL.

I think this was a bad idea. The old kind of way for viewing assemblies worked great. In fact, it was possible to troubleshoot issues with the IT department very easily: they could grasp the idea of drag-and-dropping folders into Windows Explorer. No need to know inside things about .NET. Easy. Now they have to run command line tools or I have to create installers. Hard. Bad bad decision :(

PS/Update: If anyone knows easy ways to achieve this in 4.0, or I just overlooked something, please feel free to comment. I am almost certain there are PowerShell commandlets to help us out, but haven't had time to investigate.

ASP.NET Page Lifecycle   (ASP.NET)   
I have seen many graphical representations of the ASP.NET Page Lifecycle events. Some were more complete than the next. But now I found a great textual representation, that is easy to print and use.

Unwinding the page lifecycle events