问题
We upgraded our azure deployment project from SDK 2.4 to SDK 2.5.
The project has two worker roles.
Publishing the 2.4 project to a cloud service used to work fine but after upgrading to 2.4 we see publish failing with the following output in the Microsoft Azure Activity Log Window:
4:44:19 PM - Checking for Remote Desktop certificate...
4:44:20 PM - Applying Diagnostics extension.
4:44:20 PM - Object reference not set to an instance of an object.
"Applying Diagnostics extension" is also something we used to not see in 2.4.
Any idea what causes this above error?
回答1:
Turns out this can happen if you have a mix of roles on which diagnsotics is enabled / disabled. This can happen in a few situations.
- You explicitly disabled diagnostics on some roles by editing the wadcfgx file.
- You explicitly disabled diagnostics for some roles from the UI that you get by double clicking - deployment project > Roles > RoleName.
- You upgraded a 2.4 or earlier project to 2.5. SDK 2.5 introduced a new diagnostics configuration file (.wadcfgx). When you upgrade your project, visual studio will take the old .wadcfg file and transform it into the new .wadcfgx file. Due to a bug, some times this transformation fails to create / add the new file.
The workaround is to either disable diagnostics on all roles or enable it on all roles. You can then play with the configuration in the wadcfgx file to control the data that you need to transfer / block.
来源:https://stackoverflow.com/questions/28445294/trying-to-publish-using-azure-sdk-2-5-results-in-a-null-ref-object-reference-no