tags:

views:

297

answers:

1

I downloaded Windows® API Code Pack for Microsoft® .NET Framework from http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=3077

ERROR

On testing the solution on VS 2008,I get error in line

 IKnownFolderManager knownFolderManager = (IKnownFolderManager)new KnownFolderManagerClass();
 knownFolderManager.GetFolderIds(out folders, out count);

DETAILS BELOW,

System.Runtime.InteropServices.COMException was unhandled
  Message="Retrieving the COM class factory for component with CLSID {4DF0C730-DF9D-4AE3-9153-AA6B82E9795A} failed due to the following error: 80040154."
  Source="Microsoft.WindowsAPICodePack.Shell"
  ErrorCode=-2147221164
  StackTrace:
       at Microsoft.WindowsAPICodePack.Shell.KnownFolders.GetAllFolders() in D:\WindowsAPICodePack\WindowsAPICodePack\Shell\KnownFolders\KnownFolders.cs:line 43
       at Microsoft.WindowsAPICodePack.Shell.KnownFolders.get_All() in D:\WindowsAPICodePack\WindowsAPICodePack\Shell\KnownFolders\KnownFolders.cs:line 29
       at Microsoft.WindowsAPICodePack.Samples.ExplorerBrowserTestForm..ctor() in D:\WindowsAPICodePack\Samples\ExplorerBrowser\CS\WinForms\ExplorerBrowserTestForm.cs:line 27
       at Microsoft.WindowsAPICodePack.Samples.Program.Main() in D:\WindowsAPICodePack\Samples\ExplorerBrowser\CS\WinForms\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

QUESTION

Please help to resolve this error.

+1  A: 

This error code means that the object you've requested is not registered on system. IKnownFolderManager appeared starting with Vista.

elder_george