This section lists some of the common causes of deployment problems, and offers troubleshooting tips to help you resolve the problems. An indication that a problem exists with an application is when the role instance fails to start, or it cycles between the initializing, busy, and stopping states.
Missing Runtime Dependencies
If a role in your application relies on any assembly that is not part of the .NET Framework or the Windows Azure managed library, you must explicitly include that assembly in the application package. Keep in mind that other Microsoft frameworks are not available on Windows Azure by default. If your role relies on such a framework, you must add those assemblies to the application package.
Before you build and package your application, verify the following:
Assembly Targets Wrong Platform
Windows Azure is a 64-bit environment. Therefore, .NET assemblies compiled for a 32-bit target won't work on Windows Azure.
Role Throws Unhandled Exceptions While Initializing or Stopping
Any exceptions that are thrown by the methods of the RoleEntryPoint class, which includes the OnStart, OnStop, and Run, are unhandled exceptions. If an unhandled exception occurs in one of these methods, the role will recycle. If the role is recycling repeatedly, it may be throwing an unhandled exception each times it tries to start.
Role Returns from Run Method
The Run method is intended to run indefinitely. If your code overrides the Run method, it should sleep indefinitely. If the Run method returns, the role recycles.
Incorrect DiagnosticsConnectionString Setting
If application uses Windows Azure Diagnostics, then your service configuration file must specify the DiagnosticsConnectionString configuration setting. This setting should specify an HTTPS connection to your storage account in Windows Azure.
To ensure that your DiagnosticsConnectionString setting is correct before you deploy your application package to Windows Azure, verify the following:
If you are developing your application using the Windows Azure Tools for Microsoft Visual Studio, you can use the property pages to set this value. For more information about using Visual Studio to set the configuration values, see Configuring the Cloud Service.
Exported Certificate Does Not Include Private Key
To run a web role under SSL, you must ensure that your exported management certificate includes the private key. If you use the Windows Certificate Manager to export the certificate, be sure to select the Yes, export the private key option. The certificate must be exported to the PFX format, which is the only format currently supported.
See Also
Concepts
Troubleshooting and Debugging in Windows Azure
来自 <http://msdn.microsoft.com/en-US/us/library/windowsazure/gg465402.aspx>