I've inspected the assembly Microsoft.ApplicationServer.Caching.AzureCommon
with ILSpy and I've discovered a function in which the CacheDiagnostics.ConfigureDiagnostics
searches for web.config
or *.dll.config
for the role -- on Azure enviroment it checks for both files, while if it detects the compute emulator it checks only for web.config
. IMHO this is a bug in the library (probably not so important since Caching seems to be used primarily from web roles).
I then copied the app.config
for the worker role, I've renamed it to web.config
and set it to be copied on the project output -- this way I was able to call CacheDiagnostics.ConfigureDiagnostics
without exceptions.