MSDN > 論壇首頁 > Live Framework > Exception thrown when trying to access Profiles
發問發問
 

已答覆Exception thrown when trying to access Profiles

  • 2008年11月11日 下午 12:22Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     包含代碼

    I've just been doing a quick demo silverlight app for mesh which I was planning on making the same as my console app. However, I'm getting an exception thrown whenever I try and access the Profiles object of the Live Operating Environment. I have set the application's settings as described by Danny, but this does not change anything. The start of my code is this:

                InitializeComponent(); 
     
                MeshApplicationService meshApp = Application.Current.GetMeshApplicationService(); 
                // once mesh contents are loaded we get callback 
                meshApp.LoadCompleted += new EventHandler(meshAppLoaded); 
                meshApp.Load(); 
                 
                LiveOperatingEnvironment loe = meshApp.LiveOperatingEnvironment; 
                 
                // This gets the Messenger PSM 
                Profile prof = loe.Profiles.Entries.Single(e => e.Resource.Title == "GeneralProfile"); 
                var somethingelse = (GeneralProfile)prof.Resource.ProfileInfo; 


    When debugging, just looking at the loe object, the Profiles attribute just says that it threw an exception.

    Any thoughts?

    SL - Windows Live Platform MVP
    •  

解答

  • 2008年11月21日 下午 04:59Vikas-AhujaMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Scott,  This error should be fixed with the latest build deployed last night. Please try it out!
    This posting is provided "AS IS" with no warranties, and confers no rights.

所有回覆

  • 2008年11月11日 下午 05:48Danny ThorpeMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi Scott,

    Are you running this mesh app in Live Desktop (in the browser) or on the local LOE on your local desktop?  I don't think Profiles (or Contacts) are supported yet on the local LOE.

    -Danny
    http://dannythorpe.com
  • 2008年11月11日 下午 06:38Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi Danny,

    This is when using the Live Desktop, not the local Mesh client.
    SL - Windows Live Platform MVP
  • 2008年11月11日 下午 09:55Vikas-AhujaMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    I suspect this is permissions issue. can you verify that using LivefxResourceBrowser that you have following Permission, highlighed:

          <InstalledApplicationResourceContent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://user.windows.net">  
            <Offers> 
              <Offer> 
                <OfferName>DeveloperCTPProfiles.Read</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPDevices.Read</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPContacts.Write</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPNews.Full</OfferName> 
              </Offer> 
            </Offers> 
            <Version>2</Version> 
          </InstalledApplicationResourceContent> 
      

    Danny has provided a work around for fixing permissions:
    http://social.msdn.microsoft.com/Forums/en-US/liveframework/thread/695f4201-7ab3-4942-bf45-b929f75f2237


    If above is true, similar issue was:
    http://social.msdn.microsoft.com/Forums/en-US/liveframework/thread/f16a1d6f-91b5-4082-945c-0fdee0796c09

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2008年11月11日 下午 11:23Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi Vikas,

    Thanks for the reply. I will verify with the LivefxResourceBrowser when I'm next on the PC with my project on it. I did however already do the steps described in Danny's post and the permissions were all set correctly after that (including access to the profiles).

    In the Apps settings on the website, I have the following:

    Permissions
    Read access to my Windows Live Profiles
    Read access to my Live Mesh Devices
    Read and update access to my Windows Live Contacts
    Full access to my Live Mesh User News

    I can still double check with the resource browser, but they do look correct there.

    PS. It was me who 'started' the similar thread you mentioned :)




    SL - Windows Live Platform MVP
  • 2008年11月12日 上午 02:05Mine Tanrinian 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
     Hi Scott,

    I have seen the same result as you did when trying to access Profiles with the correct permissions within a Mesh-enabled Silverlight application. 

    I have then attempted to implement the same steps through WPF Application and I was able to access the Profiles object after connecting to LiveOperatingEnvironment by passing in the correct Network Credentials.

    This behaviour reminded me the response given for New MeshObject does not look initialized and Add throws thread. Vikas, can you please confirm whether this is the expected result in the case of Profiles too?

    Thanks,
    Mine
  • 2008年11月12日 下午 05:34Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     包含代碼

    Hi Vikas, 

    Yes, I can confirm that my settings are as shown:

          <InstalledApplicationResourceContent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://user.windows.net"
            <Offers> 
              <Offer> 
                <OfferName>DeveloperCTPProfiles.Read</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPDevices.Read</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPContacts.Write</OfferName> 
              </Offer> 
              <Offer> 
                <OfferName>DeveloperCTPNews.Full</OfferName> 
              </Offer> 
            </Offers> 
            <Version>2</Version> 
          </InstalledApplicationResourceContent> 
     

    SL - Windows Live Platform MVP
  • 2008年11月13日 下午 05:31Danny ThorpeMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Scott,

    I've repro'd this issue here.  It looks like meshApp.LiveOperatingEnvironment.Profiles is broken in the Silverlight Live Framework client lib.  Any access to the Profiles property throws, even with DeveloperCTPProfiles.Read access.  We're investigating.

    Please log this as a bug so you get credit for finding it. ;>

    -Danny


    http://dannythorpe.com
  • 2008年11月13日 下午 05:40Vikas-AhujaMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Thanks Danny.

    Scott, Please log a bug on this issue using our connect site.

    FAQ thread provides the information on how to log bugs.
    http://social.msdn.microsoft.com/Forums/en-US/liveframework/thread/534719b4-4965-4d73-a18b-59c10f74e457
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2008年11月13日 下午 11:46Nishant GuptaMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
     This has been captured as a bug in our database and will look into it.

    Program Manager - Live Services / Live Framework
  • 2008年11月14日 上午 09:14Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Excellent, thanks :)
    SL - Windows Live Platform MVP
  • 2008年11月21日 下午 04:59Vikas-AhujaMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Scott,  This error should be fixed with the latest build deployed last night. Please try it out!
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2008年11月21日 下午 05:06Scott LovegroveMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Yep, that has indeed fixed it :) Thanks :)
    SL - Windows Live Platform MVP