c# - 无法调试辅助角色(模拟器)

标签 c# azure debugging xdebug azure-worker-roles

我已在 VisualStudio 2015 AZURE SDK 2.9C#

中创建辅助角色

我在每个方法的开头添加了断点:

    public override void Run()
    {

    public override bool OnStart()
    {

    private async Task RunAsync( CancellationToken cancellationToken )
    {

但是当我在 Debug模式下启动应用程序时,这些断点都没有命中。在模拟器中我看到以下消息:

[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

我做错了什么?如何在断点处停止辅助角色?

最佳答案

经过小调查,我找到了问题的根源:

更改角色类别后:

public class IntegrationsSyncRole: RoleEntryPoint

public class IntegrationsSyncRole: DistributedJobRole
...
public class DistributedJobRole: RoleEntryPoint

断点停止命中。

解决方案是删除中间类并从 RoleEntryPoint 继承 IntegrationsSyncRole,而不使用任何其他类。

关于c# - 无法调试辅助角色(模拟器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39757022/

相关文章:

c# - 在 Visual Studio 2015+ 中,如何确定哪个对象导致了 null 异常?

c# - TDD:静态方法、依赖注入(inject)、缓存,还有你!

c# - 如何将用户输入的字符串作为字段名传递以访问对象中的字段?

azure - 如何迁移 Azure Service Fabric 中的 Windows 服务

azure - 我可以/应该将 Asp.Net Identity 与组织帐户一起使用吗?

c++ - 如何捕获 C++ 代码中奇怪的未定义行为?

删除数组时检测到 C++ 堆损坏

c# - 如何在 C# 中使用 XmlSerializer 将字节数组序列化为 XML?

c# - WPF 媒体格式

azure - 当区域出现故障时,单个 Azure VM 会发生什么情况