UserProfileManager作为全局变量

时间:2012-01-31 12:07:04

标签: visual-studio visual-studio-2010 sharepoint sharepoint-2010

我正在使用Visual Studio 2010 for Sharepoint 2010进行开发。我有一个很好的课程。其中有一个UserProfileManager变量的多个实例,有时甚至在循环内,因此反复创建对象。我正在尝试在类构造函数中创建此对象一次,然后在类中需要时使用相同的对象但是我有这样的错误消息:

Failed to create receiver object from assembly "MyProject,
class "MyProject.Features.CentralAdminFeature.CentralAdminFeatureEventReceiver
for feature "MyProject_CentralAdminFeature":
System.Reflection.TargetInvocationException: Exception has been thrown by the target
of an invocation. ---> System.NullReferenceException: Object reference not set to an
instance of an object.

有一些原因导致无法将此对象的实例创建为全局变量吗?

0 个答案:

没有答案