SQL Server Configuration Manager – Cannot connect to WMI provider

I was trying to access my SQL Server 2008 R2 Network Configuration to enable Tcp/Ip connections to my server through the SQL Server Configuration Manager from the Configuration Tools. But suddenly an error message appeared indicating that I can’t access my configuration manager through the WMI provider. The error message that popped up is shown down below:

 

 

As we can see above, the error pop up dialog indicates that I don’t have the permission to access the server or it’s unreachable. But SQL Server is already installed properly on my machine and I can access the instance through the Microsoft SQL Server Management Studio. So, why this error occurred ?

This error occurs when the .mof files (Microsoft Object Format) are damaged or not properly installed and registered during the MS SQL Server 2008 R2 installation process.

In order to solve this issue, we have to do the following steps:

  1. Run the command prompt as administrator.
  2. Change the directory to the following path: “C:\Program Files (x86)\Microsoft SQL Server\100\Shared”.
  3. Use the mofcomp.exe to register the .mof file again by running the following command: mofcomp.exe “C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof”

using mofcomp.exe

Remark: mofcomp.exe is used to compile Managed Object Format (MOF) code into binary form stored in the WMI repository. Use when creating or modifying the MOF file for a WMI provider. mofcomp.exe is one of the WMI Command Line Tools in Windows.

Now the MOF file in SQL Server 2008 R2 is parsed successfully and the SQL Configuration Manager will execute without any error.

 

Cannot use a leading .. to exit above the top directory

When you use relative paths incorrectly in ASP.NET an exception will be thrown of the following error message: “Cannot use a leading .. to exit above the top directory”.

This usually occurs when you write a static url or generate a dynamic one with many upward levels back to the root directory like “../../”. So, while running the website the exception will be handled.

As an example, let’s say that you’re website contains the following link code section:

<!-- Style -->
<link rel="shortcut icon" href="icon.ico" />
<link href="../css/flags.css" rel='stylesheet' type='text/css'>
or 
<asp:Image ImageUrl="../flag.png" />

What happens here is that your webpage is referring or want to access a content which is in the root folder or in a folder of one level up from the current webpage you’re standing at. Till now everything seems logical and true.

But the error occurs when this webpage is basically at the root level and no any upper level exists, where the content you want to access is either at the same level or at any other level in your website since you can’t skip or jump above the root level. So, the webpage won’t be able to refer to a content of one level up “../” since the page itself is at the root folder.

You have to always watch out the using of relative paths whether in HTML or in ASP.NET code like Server.Transfer or Server.Redirect since the request of a wrong relative path will cause a run time exception.

Entity Framework now Open Sourced

Few months after Microsoft open sourced the ASP.NET MVC 4 and ASP.NET Web API, the Entity Framework source code is released under an open source license, and the code repository is now CodePlex.

This step will enable all the developers to contribute and engage in providing code, fixing bugs and new development features to be implemented in new versions after being tested. This will enhance the Entity Framework since it’s being daily tested and built, which will lead to a better product for object relational mapping.

The open sourced code includes Entity Framework Runtime and NuGet packages, Code First, the DbContext API (introduced in EF 4.1), the Entity Framework Power Tools which are already found and included in the .NET Framework.

For more details, you can find all what you’re looking for on Entity Framework CodePlex.