English 中文(简体)
用户简介服务——习俗财产——不成立财产
原标题:User Profile Service - Custom Property - Property Not Found

我随同我的用户简介处附上了我的主动名录,并增加了从自动取款的习惯财产(雇员)。 用户简介服务在全面总结后,即能够正确阅读所有雇员住房财产价值,而且用户概况在行政小组中为69个。

但是,在试图阅读我共同点申请中雇员人数数据时,它放弃了“财产不成立”这一例外情况,而用户名管理人的财产价值是68。

我已经把我的习惯财产设定为“人人”的隐私环境,并相应地确保,在我的法典中使用正确的内部习惯财产名称。

任何建议?

我的法典样本如下:

            SPServiceContext serverContext =  SPServiceContext.GetContext(SPContext.Current.Site);  
            UserProfileManager profileManager = new UserProfileManager(serverContext);  
            UserProfile user =  profileManager.GetUserProfile(System.Web.HttpContext.Current.User.Identity.Name);

            int count = profileManager.Properties.Count; // Count = 68 [custom prop is not included]
            string department = user["Department"].Value.ToString(); // Works fine
            string employeeNumber = user["employeeNumber"].Value.ToString(); // Property Not Found
问题回答

其中一个原因可能是,你创建了不止一个用户简介服务应用程序,而网络应用(你正在尝试上述代码)则使用服务申请,而不是你添加习惯财产。





相关问题
SharePoint 2010 Blog site template and post security

I asked this question on msdn forums but got no response in 24 hours. I am pasting the question here, I am sure you guys out there can help me :) This is my first post: I created a blog site with SP ...

Sharepoint 2010 - Custom Ribbon

i m developing a sharepoint project and central admin pages (located in _layouts), and i want to use Ribbon bar. i have found this sample but i hope so, it is wrong.. http://sharepointsolutions.com/...

Printing an InfoPath 2010 form in SharePoint 2010

Does anyone know where the option to print an infopath form (in my case a customized list form) exists in SharePoint 2010? In MOSS this functionality comes out of the box but either I am missing ...

Sharepoint 2010 Email Event Receiver not firing?

I have two event recievers setup on a list in 2010. The first is a ItemAdded reciever that works every time: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft....

Access Services and SharePoint 2010 - Need Info

I ve been asked to research the ability to publish Access solutions directly to SharePoint as demonstrated in the demo below. http://channel9.msdn.com/shows/Access/Microsoft-Access-2010-Demo/ I m ...

热门标签