Azure Diagnostics Issue When Called from Another Assembly
-
2012年2月16日 19:25
We are developing several Azure-based applications in C# and are attempting to centralize some common code in a utility library. One of the common functions is Diagnostic monitoring setup.
We created a class that simplifies the configuration of diag collection, log transfer, etc.
The main issue we are facing is that when we run our code while the class lives in a different assembly from the WebRole or WorkerRole, the diagnostic information is never collected and transferred to azure table storage. If we move the class to the same project as the Web/Worker role, then everything works as expected.
Is there something that either the DiagnosticMonitor.GetDefaultInitialConfiguration(); or the DiagnosticMonitor.Start(StorageConnectionStringKey, _diagConfig); doesn't like about being in another assembly? I'm stumped!
Any insight would be appreciated.
Thanks, Matt
すべての返信
-
2012年2月17日 10:07
Here is a full sample to show how to use it
http://code.msdn.microsoft.com/Windows-Azure-Diagnostics-acc66c1a
-
2012年2月17日 14:45
Thanks for the reply, GYW_AR.
I just want to clarify that the code works perfectly if our custom "setup" class lives within the same project as the WorkerRole or WebRole. As soon as we move the same class file to an external assembly, the code stops functioning.
Thanks,
Matt
-
2012年2月19日 3:49
Are you creating this utility as a subclass of roleentypoint? How you utility is being called from RoleEntryPoint?

