Azure:从未调用 WebRole OnStart()

标签 azure azure-web-roles

我的 Azure 解决方案中有一个简单的 WebRole 类:

public class WebRole : RoleEntryPoint
{
    public override bool OnStart()
    {
        DiagnosticMonitor.Start("DiagnosticsConnectionString");

        // For information on handling configuration changes
        // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
        RoleEnvironment.Changing += RoleEnvironmentChanging;

        CloudStorageAccount.SetConfigurationSettingPublisher(
            (configName, configSettingPublisher) =>
            {
                string connectionString = RoleEnvironment.GetConfigurationSettingValue(configName);
                configSettingPublisher(connectionString);
            }
        );

        return base.OnStart();
    }
    // ...
}

由于某种原因,当我运行项目时,我无法在 OnStart() 中设置断点。为什么会这样?

最佳答案

一种可能性是您的启动项目是您的 Web 应用程序而不是云项目。确保云项目是启动项目,然后验证您的应用程序是否在开发结构中运行。

关于Azure:从未调用 WebRole OnStart(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3897542/

相关文章:

json - 在 Azure 中链接两个 ARM 模板的最佳方法是什么

azure - 如何使用 Azure Powershell 更新 Azure 云服务设置

asp.net - 内部 Azure WCF 服务是否需要安全性

azure - 如何在不明确指定版本的情况下将 Azure 角色切换到 Windows Server 2008 R2?

Azure云服务网络带宽

azure - 使用 header 而不是 Cookie 定位特定的 Azure Web 应用程序实例

azure - 错误 :C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy. exe 失败,返回代码:4294967295

powershell - Azure Powershell Cmdlet 和证书过期

azure - 如何在Azure服务总线中向主题的订阅添加过滤器

azure-web-roles - Windows Azure 无法在端点数量不同的部署之间执行 VIP 交换