NServiceBus终结点未在Azure Service Fabric本地群集上启动 [英] NServiceBus endpoint is not starting on Azure Service Fabric local cluster

查看:82
本文介绍了NServiceBus终结点未在Azure Service Fabric本地群集上启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Service Fabric本地群集中运行了.NetCore无状态WebAPI服务.

I have a .NetCore stateless WebAPI service running inside Service Fabric local cluster.

 return Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();

当我尝试启动NServiceBus端点时,出现此异常:

When I'm trying to start NServiceBus endpoint, I'm getting this exception :

拒绝访问路径"C:\ SfDevCluster \ Data_App_Node_0 \ AppType_App10 \ App.APIPkg.Code.1.0.0.diagnostics".

Access to the path 'C:\SfDevCluster\Data_App_Node_0\AppType_App10\App.APIPkg.Code.1.0.0.diagnostics' is denied.

如何解决? VS在管理员下运行.

How can it be solved ? VS is running under administrator.

推荐答案

您遇到的问题是因为您尝试写入的文件夹不应该由您的应用程序写入.

The issue you are having is because the folder you are trying to write to is not supposed to be written by your application.

package文件夹用于存储您的应用程序二进制文件,并且只要将应用程序托管在节点中就可以动态重新创建.

The package folder is used to store you application binaries and can be recreated dynamically whenever an application is hosted in the node.

此外,二进制文件可被在同一节点上运行的多个服务实例重用,因此它可能会竞争使用不同实例的文件.

Also, the binaries are reused by multiple service instances running on same node, so it might compete to use the files by different instances.

您应该指示您的应用程序写入WorkFolder

You should instead instruct your application to write to the WorkFolder,

public Stateless1(StatelessServiceContext context): base(context)
{
   string workdir = context.CodePackageActivationContext.WorkDirectory;
}

上面的代码将为您提供这样的路径:

The code above will give you a path like this:

'C:\SfDevCluster\Data_App_Node_0\AppType_App10\App.APIPkg.Code.1.0.0.diagnostics\work'

此文件夹是动态的,将根据应用程序正在运行的节点或实例而变化,创建后,您的应用程序应该已经具有写入权限.

This folder is dynamic, will change depending on the node or instance of your application is running, when created, your application should already have permission to write to it.

有关更多信息,请参见:

For more info, see:

查看全文

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