VS .NET 2008 design mode issue

Today I came across a strange issue related to VS .NET 2008 design mode. I was coding a c# stand-alone application whose purpose was to connect to database using NHibernate library. I created a couple of controls which all inherit from DevExpress.XtraEditors.XtraUserControl (btw. I am using DexExpress in this project). The controls were using NHibernate DAOs in order to load data from database. However, when I was trying to edit them in Visual Studio designer I kept getting the following error:

vs_design_mode

Of course, as you may probably have guessed, I have not paid too much attention to catch NHibernate exceptions properly and that is why the exception in the picture above crashes VS designer. Nevertheless, something should be done to handle such issues properly. After a few minutes of google’ing I have found the solution. I put it here, simply because the useful information on the Internet is apt to dissapear quickly:

public class BaseDesignModeUserControl : UserControl
{
private static readonly bool isDesignMode;

static BaseDesignModeUserControl()
{
isDesignMode =
(System.Diagnostics.Process.GetCurrentProcess().
ProcessName.IndexOf("devenv")
!= -1);
}

protected bool IsDesignMode
{
[DebuggerStepThrough]
get
{
return isDesignMode;
}
}

}

SQL Server 2005 issue.

A few days ago I was forced to install and use SQL Server database on my system. A few days later I had to install MS VS .NET 2008. After that, it turned out that the standard utility SQL Server Configuration Manager does not seem to work correctly. It shows a message box that contains the following error:
Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager.
Nie można znaleźć określonego modułu. [0x8007007e]

Unfortunately, I could not find any working solution of this problem (perhaps it is so because my knowledge of Microsoft’s database is less than miserable ) Some pages suggested running Mof-compiler program with *.mof file from SQL Server installation directory but it does not work in my case.

EDIT: After some time I figured out what should done to solve this problem. It is simple. It just requires copying framedyn.dll file from folder: “C:\WINDOWS\system32\wbem” to folder: “C:\WINDOWS\system32”.