Particular/ServiceControl — pull request #140 by esculli (2013-12-11 21:42:45+00:00)
Title: Fixed problem with Static and Assembly.GetExecutingAssembly

After a lot of testing and trying to detect what it's going on with ServiceControl.Plugin.DebugSession plugin on Web projects, I detected a possible issue.

Besides some of you tried some solutions I created, them dosn't always work for me. They worked randomly. Trying different scenarios to try to find the root cause, I detect a possible problem on the way we're calculating the path to ServiceControl.DebugSessionId file on the Bin folder.

The file location is calculated based on Assembly.GetExecutingAssembly(), and it's calculated inside an static method. Researching about it, I found it can cause random behaviors because it can be executed from many contexts (http://stackoverflow.com/questions/121946/assembly-getcallingassembly-and-static-constructors).

This fix moves the calculation of the file to a non-static method. I tried locally this fix, and it always works: DebugSession header is added in all sent messages.

Can we merge this pull request? So, I can try the fix using the NuGet package generated by the build server.

This is related with:
https://github.com/Particular/ServiceMatrix/issues/92
https://github.com/Particular/ServiceControl/issues/132