burzhuy burzhuy - 1 year ago 93
C# Question

Can't debug worker role (emulator)

I have created worker role in

VisualStudio 2015

i added breakpoints to start of the each method:

public override void Run()

public override bool OnStart()

private async Task RunAsync( CancellationToken cancellationToken )

but when i start my application in debug mode none of these breakpoints hits. In emulator i see this messages:

[fabric] Role Instance: deployment29(49).Channels.Jobs.Integr.Sync.Jobs.0

[fabric] Role state Started

[runtime] Role entrypoint . CALLING OnStart():Integr.Sync.Jobs.DistributedJobRole

[runtime] Role entrypoint . COMPLETED OnStart(): Integr.Sync.Jobs.DistributedJobRole

[runtime] Role entrypoint . CALLING Run():Integr.Sync.Jobs.DistributedJobRole

what I'm doing wrong? how to stop worker role on breakpoints?

Answer Source

After small investigation i found the root of the problem:

after changing role class from:

public class IntegrationsSyncRole: RoleEntryPoint


public class IntegrationsSyncRole: DistributedJobRole
public class DistributedJobRole: RoleEntryPoint

breakpoints stopped hitting.

Solution was to remove intermediate class and inherit IntegrationsSyncRole from RoleEntryPoint without any other classes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download