使用azure服务总线调试Visual Studio .net应用程序的替代方法

问题描述 投票:0回答:1

在过去,当我开发实现远程事件接收器的SharePoint Provider-Hosted应用程序时,我使用Azure Service Bus来调试代码,如此https://blogs.msdn.microsoft.com/kaevans/2014/02/26/attaching-remote-event-receivers-to-lists-in-the-host-web/中所述,其中Azure内部我创建了一个新的服务总线>> i copy the primary connection字符串,如下: - enter image description here

然后在Visual Studio项目>> Properties >> SharePoint >>中添加上面的服务总线的主连接字符串,如下所示: - enter image description here

这让我可以调试我的代码。但是上周当我试图这样做时,我在运行项目后在Visual Studio中出现了这些错误: -

从Microsoft Azure Service Bus取消注册了一个或多个服务。无法在Microsoft Azure Service Bus上注册Services / AppEventReceiver.svc:无法连接到远程服务器

如下: - enter image description here

所以我读到使用azure服务总线已经从2018年9月开始由Microsoft退役。但与此同时我没有找到使用Azure Service Bus调试sharepoint提供商托管应用程序的任何替代方案。所以有人可以就此提出建议吗?

.net visual-studio azure azureservicebus sharepoint-apps
1个回答
1
投票

您可以使用ngrok as a proxy在本地调试应用程序,而无需使用Service Bus。

将localhost传递给Sharepoint的问题是,正如您所指出的那样,Sharepoint无法与之通信。 ngrok为您提供了Sharepoint可以访问的公共URL,然后通过ngrok服务将其路由到本地计算机。这与Service Bus正在进行的操作相同 - 提供路由到本地的公共URL。

您可以注册{id} .ngrok.io / Services / AppEventReceiver,而不是使用Sharepoint注册localhost:44332 / Services / AppEventReceiver.svc,其中id是启动本地ngrok服务时生成的id。

© www.soinside.com 2019 - 2024. All rights reserved.