Azure: WebRole OnStart() is never called
I have a simple WebRole class in my Azure solution:
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);
c开发者_JAVA技巧onfigSettingPublisher(connectionString);
}
);
return base.OnStart();
}
// ...
}
For some reason, I can't get breakpoints in OnStart()
to be hit when I run the project. Why might this be?
One possibility is that your startup project is your web application instead of the cloud project. Make sure that the cloud project is the startup project, and then verify your app is running in the development fabric.
精彩评论