呼叫远程事件接收器上的无意义异常 [英] Pointless exception on call Remote Event Receiver

查看:89
本文介绍了呼叫远程事件接收器上的无意义异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


我尝试为SharePoint Server 2016 + Project Server实现一个简单的远程事件接收器,并模拟生产环境以检查它们的可能性。


我已经通过VS office工具模板2016创建了App项目,其中包含继承IProjectEventReceiverRemote和IRemoteEventService接口的WCF服务。


我有测试pfx和App id对于提供程序托管的应用程序,将此键设置为Add-In项目中的AppManifest。


我已经在测试目录中的dev farm上发布了app-packege,并批准了对此应用程序的完全信任。


我已在单独的mashine托管IIS上发布了Web应用程序,并将密钥设置为https。


已测试通过https从SharePoint计算机的浏览器连接到我的终端 - 好的,我可以看到默认的WCF服务页面。


然后我用CSOM通过此代码订阅了PorjectCheckIn事件

 static void CreateReceiver(PSEventID eventID,string endPoint = EndPoint)
{
ProjectContext projectContext = new ProjectContext(URL);

projectContext.Credentials = new System.Net.NetworkCredential(" my_user",GetPassword());
projectContext.EventHandlers.Add(new EventHandlerCreationInformation()
{
EventId =(int)eventID,
EndpointUrl = endPoint,
Id = Guid.NewGuid(),
Name =" RER_" + eventID.ToString(),
Description =" Created with CSOM",
Order = 100
});
projectContext.EventHandlers.Update();
projectContext.ExecuteQuery();
}

现在,当我测试签到时,我在SharepointEvent日志中遇到了这个错误:


SEP:调用endpointUrl https://my_site_name/services/MyService.svc失败。错误'调用的目标已抛出异常。'StackTrace'  

  at System.RuntimeMethodHandle.InvokeMethod(Object target,Object [] arguments,Signature sig,Boolean constructor)    

 在System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,Object [] parameters,Object [] arguments) 在System.Delegate.DynamicInvokeImpl(Object [] args)    

  at Microsoft.Office.Project.Server.Events.ServerEventProxy.CallRemoteEventReceiver(DelegateInfo del,PSContextInfo contextInfo,String name,IPostEventArgs args)    

  at Microsoft.Office.Project.Server.Events.ServerEventProxy.FirePostDelegate(PSContextInfo contextInfo,String name,IPostEventArgs args)'


导致此异常的原因是什么?我能以某种方式获得内部异常吗?


解决方案


在打包到IIS之前调试服务会更好可以捕获异常。


以下是一些关于自定义项目服务器的远程事件处理程序的线程供您参考。


http://www.umtsoftware.com/blog/project-server-2013-remote-event-handlers/


http://blog.programframework.com/projectserver/projectserver2013/how-to-create-a-remote-event-handler-for-project-server-2013-project-online/


如果您需要进一步的帮助,我建议您发布信息在下面的项目自定义和编程论坛中。


https://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=project2010custprog


我们建议适当发布的原因是您将获得最合格的受访者群体以及其他阅读论坛定期可以分享他们的知识,也可以从
中学习与我们的互动。 


感谢您的支持理解。


最好的问候,



Hello.

I try to realize a simple Remote Event Receiver for SharePoint Server 2016 + Project Server and emulate production environment to check their possibilities.

I have created the App project by the VS office tools template 2016 with WCF service that inherit the IProjectEventReceiverRemote and IRemoteEventService interfaces.

I have got the test pfx and the App id for provider-hosted application, set this keys into AppManifest in Add-In porject.

I have published app-packege on dev farm in the Test catalog with approving full-trust for this app.

I have published the web-application on a separate mashine hosted IIS and set the key to https.

Have tested connect to my endpoint from the SharePoint machine's browser by https - ok, i can see default WCF-service page.

Then i subscribed on PorjectCheckIn event with CSOM by this code

static void CreateReceiver(PSEventID eventID, string endPoint = EndPoint)
        {
            ProjectContext projectContext = new ProjectContext(URL);

            projectContext.Credentials = new System.Net.NetworkCredential("my_user", GetPassword());
            projectContext.EventHandlers.Add(new EventHandlerCreationInformation()
            {
                EventId = (int)eventID,
                EndpointUrl = endPoint,
                Id = Guid.NewGuid(),
                Name = "RER_" + eventID.ToString(),
                Description = "Created with CSOM",
                Order = 100
            });
            projectContext.EventHandlers.Update();
            projectContext.ExecuteQuery();
        }

Now, when i do test check-in, i got this error in SharepointEvent log:

SEP: Calling endpointUrl https://my_site_name/services/MyService.svc failed. Error 'Exception has been thrown by the target of an invocation.' StackTrace '  
 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)    
 at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)    
 at System.Delegate.DynamicInvokeImpl(Object[] args)    
 at Microsoft.Office.Project.Server.Events.ServerEventProxy.CallRemoteEventReceiver(DelegateInfo del, PSContextInfo contextInfo, String name, IPostEventArgs args)    
 at Microsoft.Office.Project.Server.Events.ServerEventProxy.FirePostDelegate(PSContextInfo contextInfo, String name, IPostEventArgs args)'

What reasons can cause this exception? Can i get the inner exceptions somehow?

解决方案

Hi,

It would be better to debug your service before packaging to IIS so you could catch the exception.

Here are some threads about customizing remote event handler for project server for your reference.

http://www.umtsoftware.com/blog/project-server-2013-remote-event-handlers/

http://blog.programframework.com/projectserver/projectserver2013/how-to-create-a-remote-event-handler-for-project-server-2013-project-online/

If you would like further assistance, I would suggest you post in Project Customization and Programming forum below.

https://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=project2010custprog

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. 

Thanks for your understanding.

Best Regards,

Lee


这篇关于呼叫远程事件接收器上的无意义异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆