Accurately Detect Operating System Version In C#

.Net's Environment.OsVersion object gives us the version information of the OS we are running under - its Platform property gives us the OS family and we can then use the Version property to narrow down the specific OS. This article from Microsoft outlines a function that detects the curren... [More]

Ajax .Net TabControl In IE: 1 Pixel Gap Between Tab Header and Body

Ok, so this was weird and took a while to track down. After setting some styles for a TabControl, a 1 pixel gap appeared between the tabs in the header of the control and the tab body: Firefox had no issue as usual. After the traditional flurry of setting margins and padding to 0 on every blo... [More]

Open .dtsx For Debug - Why The Debug Buttons Are Disabled

Thanks to Michael Entin's helpful article this was one of those head slapping moments. He explains that if you load a .dtsx file standalone into Visual Studio the debug buttons are disabled because it is the project configuration that facilitates these. So the solution is to create a new SSIS ... [More]

Nunit Doesn't Refresh References

Update: I found today that if you load the options dialog of Nunit and tick 'Disable Shadow Copy (default: Enabled)' Nunit correctly loads the latest references. You need to unload the test project from Nunit when building the dll in Visual Studio to release Nunit's lock on the file. M... [More]

Renaming A Column in SQLCE

Because of Compact Edition's limited features, to rename a column you need to create a new column with the desired name, copy any data from the old column to the new, and finally delete the old column. The example below renames an integer column in SQLCE.   Jimmy   ... [More]

IIS 6.0 - HTTP 404 - File not found Internet Information Services

I've come across this problem a few times and the solution is frustratingly simple and not so obvious given the error message, so I'll note it here. After checking the obvious (making sure the file exists in the location mapped to the virtual directory) I found this support article from Mi... [More]

Quickly and Easily Take Your ASP.Net 2.0 Web Site Offline For Maintenance

I found this handy feature of the ASP.Net 2.0 Framework today: If you want to disable all access to your ASP.Net 2.0 web site you can just place a file called App_Offline.htm in you root directory. All requests to any folder of the site are directed to this page, so you can write a friendly 'Dow... [More]

Dotnetnuke Object Reference Not Set to an Instance of an Object: FreeTextBoxControl

I came across a strange problem with the article module in Dotnetnuke. When a user clicked on the edit button of an article, a 'Critical Error' would occur. If they clicked the edit button again, the edit page would load with no issues. The Site Log gave the full error message: DotNetNuke... [More]

Dotnetnuke Critical Error: Cannot resolve the collation conflict between SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AS

One of our Dotnetnuke sites couldn't access the Site Log in the administrator section. The site displayed something along the lines of 'Critical error has occurred' but after logging in as host I found the full description to be: Cannot resolve the collation conflict between SQL_L... [More]

ASP.Net AJAX ModalPopupExtender: Performing an Asynchronous Postback

The ModalPopupExtender in the AjaxControlToolkit is great for showing a modal dialog in ASP.Net web sites. Recently I needed to have my dialog perform some server-side code when the user hit the 'Ok' button. This would require a postback which I wanted to be asynchronous so it would be sea... [More]
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010