none
在WindowsPhone8 中使用CreateFileQueryWithOptions 抛出异常 LoadTypeException RRS feed

  • 问题

  • 代码如下

     Windows.Storage.Search.StorageFileQueryResult a = ApplicationData.Current.LocalFolder.CreateFileQueryWithOptions(
                    new Windows.Storage.Search.QueryOptions() { FolderDepth = Windows.Storage.Search.FolderDepth.Shallow, UserSearchFilter = "System.FileName:\"TestFolder.xx\"" }
                    );

    在执行时抛出LoadTypeException 显示 QueryOption未注册

    {System.TypeLoadException: Requested Windows Runtime type 'Windows.Storage.Search.QueryOptions' is not registered. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
       --- End of inner exception stack trace ---
       at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
       at Windows.Storage.Search.QueryOptions..ctor()
       at SNSComponentSample.WP8.MainPage.<Button_Click>d__1.MoveNext()}

    InnerException: System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))}

    可是文档显示 Windows Phone8 是支持的 。。。 http://msdn.microsoft.com/zh-cn/library/windowsphone/develop/windows.storage.search.queryoptions.aspx

    是什么歌情况??


    WP7 开发论坛 Windows Phone Developer Network www.wpdevn.com 群:38595254

    2013年7月9日 17:24