About a year ago I was able to get NSB standing up and working great on Azure in a WorkerRole. We implemented a few services. It took some work, there were several issues revolving around dependencies and versions however after much tweaking, we got things up and running.
So fast forward to today, new product, trying to stand up a simple example, proof of concept in an exploration phase with NSB v4.0 for a system we are building. I wanted to stand up the AzurePubSub example located here; https://github.com/Particular/NServiceBus.Azure/tree/develop/IntegrationTests/AzurePubSub
Having a heck of a time just getting the sample to run. I have documented out the steps I have taken;
Using VS 2k12, NSB 4.0 (latest stable)
- Open AzurePubSub project
- Prompted to Convert the project to target Windows Azure Tools - v2.1 (converted)
- Drop NSB ref from MyMessages, replaced with Nuget NServiceBus.Interfaces pkg
- Clean Build on MyMessages
- OrderService, dropped NServiceBus, NServiceBus.Core, NServiceBus.Azure, NServiceBus.Hosting.Azure, Common.Logging
OrderService, replaced above with NuGet package (NServiceBus.Hosting.Azure).
OrderWebsite dropped NServiceBus, NServiceBus.Azure, NServiceBus.Core , Common.Logging
OrderWebsite, replaced above with NuGet package (NServiceBus.Azure).
Achieved a clean Solution Build!
Debug
Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Added Binding Redirects to OrderWebsite manually (optionally could ref NuGet for Diagnostics)
- Debug
Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Added Binding Redirects to OrderService manually (optionally could ref NuGet for Diagnostics)
Debug
Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
- Dropped Microsoft.WindowsAzure.Diagnostics Reference 2.0.0.0
Added Microsoft.WindowsAzure.Diagnostics Reference to 2.1.0.0 (file version 2.1.6493.0) to both OrderService and OrderWebsite (left binding redirects in)
Debug OrderWebsite loads up nicely. OrderService get caught in a loop Starting and stopping seen via the Azure Compute Emulator. EndpointConfiguration ctor never gets called, nor the DefineRouting class IProvideConfiguration implementation.
Azure Compute Emulator ouput:
[fabric] Role Instance: deployment21(119).AzureService.OrderService.0 [fabric] Role state Unhealthy [Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, ) [Diagnostics]: Acquired mutex [Diagnostics] Information: C:\Users\Ryan\AppData\Local\dftmp\Resources\a903dc1b-98a5-4a78-b04d-c533e881564d\directory\DiagnosticStore\Monitor [Diagnostics] Information: D:\GitHub\NServiceBus.Azure\IntegrationTests\AzurePubSub\csx\Debug\roles\OrderService\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\Ryan\AppData\Local\dftmp\Resources\a903dc1b-98a5-4a78-b04d-c533e881564d\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\Ryan\AppData\Local\dftmp\Resources\a903dc1b-98a5-4a78-b04d-c533e881564d\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\Ryan\AppData\Local\dftmp\Resources\a903dc1b-98a5-4a78-b04d-c533e881564d\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-81011d9e243b47bc8941b805e7146ce3 -InitializedEvent WADM-StartUp-81011d9e243b47bc8941b805e7146ce3 -parent 5704 -events [fabric] Role state Stopping [Diagnostics]: Creating config channel server [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-81011d9e243b47bc8941b805e7146ce3 is signaled. [MonAgentHost] Output: Will signal WADM-StartUp-81011d9e243b47bc8941b805e7146ce3 after the agent is initialized. [MonAgentHost] Output: Registered as an event consumer. [MonAgentHost] Output: Agent will exit when parent process 5704 exits. [MonAgentHost] Output: Monitoring Agent Started [Diagnostics]: Starting configuration channel polling [runtime] Role entrypoint . CALLING OnStart() [runtime] Role entrypoint . COMPLETED OnStart() [runtime] Role entrypoint . CALLING Run() [runtime] Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED [runtime] Role instance recycling is starting [runtime] Role entrypoint . CALLING OnStop() [runtime] Role entrypoint . COMPLETED OnStop() [fabric] Role state Busy
And this is where it loops over and over again. Error is obviously happening on initializing things with the Worker Role for the OrderService, however I can't seem to located just what is going wrong.
Anyone have any ideas on how I can pinpoint the cause?
Many thanks, Ryan