Friday, March 11, 2011

Windows Azure Refactoring Bug


Steps:
  1. Create a Azure Web Project with WCFServiceWebRole with default settings
  2. Change the default name in Solution Explorer of the associated Web Service by renaming the project name.
  3. File AzureLocalStorageTraceListener.cs will throw an error in line
    directory.Path = RoleEnvironment.GetLocalResource("WCFServiceWebRole.svclog").RootPath;
    
    where the .svclog file name will depend on the new name you gave to the service
This happens because one of the configuration files ServiceDefinition.csdef has not been updated with the proper name.

Solution:
Open ServiceDefinition.csdef and change

<LocalResources>
<LocalStorage name="WCFServiceWebRole.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
</LocalResources>

to reflect your new name of the service as the .svclog file.

No comments: