我在2010年的列表中设置了两个事件接收器。
第一个是每次都有效的ItemAdded接收器:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="10000">
<Receiver>
<Name>ListItemReceiverItemAdding</Name>
<Type>ItemAdding</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>SSW.TipDontRant.Sharepoint.ListItemReceiver</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
第二个是电子邮件事件接收器,我只有preiodicaly开始工作..在30-40次尝试调试应用程序时,我只在2个案例中工作。
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="10000">
<Receiver>
<Name>EmailReceiverEmailReceived</Name>
<Type>EmailReceived</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>SSW.TipDontRant.Sharepoint.EmailReceiver</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
我已经附加到OWSTimer并且ListTemplateId确实是正确的。
在将日志检查为sugested时,我发现了以下错误:
12/11/2009 17:12:54.01 OWSTIMER.EXE (0x2314) 0x046C SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Timer Job job-email-delivery) 7b525bbb-0972-4115-97b1-19b1d94ff8c5
12/11/2009 17:12:54.03 OWSTIMER.EXE (0x2314) 0x046C SharePoint Foundation E-Mail 6873 Warning An error occurred while processing the incoming e-mail file C:\inetpub\mailroot\Drop\24c6872e01ca7a8500000003.eml. The error was: Object reference not set to an instance of an object.. 7b525bbb-0972-4115-97b1-19b1d94ff8c5
12/11/2009 17:12:54.03 OWSTIMER.EXE (0x2314) 0x046C SharePoint Foundation E-Mail 6871 Information The Incoming E-Mail service has completed a batch. The elapsed time was 00:00:00.0190038. The service processed 1 message(s) in total. Errors occurred processing 1 message(s): Message ID: <B05256D324B3D540853A95FF2AD9B257801F931C81@mooncalf> 7b525bbb-0972-4115-97b1-19b1d94ff8c5
12/11/2009 17:12:54.03 OWSTIMER.EXE (0x2314) 0x046C SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Timer Job job-email-delivery). Execution Time=23.4762559268986 7b525bbb-0972-4115-97b1-19b1d94ff8c5
在这里阅读有点困难,但我认为重要的一点是:
处理传入电子邮件文件C:\ inetpub \ mailroot \ Drop \ 24c6872e01ca7a8500000003.eml时发生错误。错误是:对象引用未设置为对象的实例.. 7b525bbb-0972-4115-97b1-19b1d94ff8c5
哪个不告诉我多少!我不认为这是我的代码错误,因为它将在Visual Studio中抛出。我可以确认发送到文档库的电子邮件也能正常工作。
[更新]我在周末离开了我的代码,根本没有触摸它,现在它正在工作!这个问题在Sharepoints部分非常明显。
所以,我现在让我的代码行失败了(注意我之前没有这么做)并且它是对外部程序集的引用,我已经打开了另一个问题Sharepoint 2010 Project package: Cannot add a new project output assembly to the package < / p>
答案 0 :(得分:1)
看起来这是VS2010 Beta 2或Sharepoint 2010测试版中的错误。
要解决中级问题,您需要删除该网站,停用并删除解决方案,然后重新启动您的环境。
只有当您对列表和事件接收进行结构更改并且仅接缝影响电子邮件事件接收器时,才会发生这种情况...