Debug single role instance with Azure Compute emulator Debug single role instance with Azure Compute emulator azure azure

Debug single role instance with Azure Compute emulator


The emulator (similar to Azure itself) works just on the concept of a "Cloud Service". So when you launch w/ debug, its going to launch whatever is defined in your Cloud Service (.ccproj) project. This mimics Azure 100% which is why it occur, but I can definitely see where your scenario would be helpful.

Few options, based on your needs.

If you need to test azure-specifics (aka it has to run in the emulator)

  • Create a second solution file, create a new Cloud service in here, add your project. I like this option because the projects/roles themselves remain untouched.

  • What Stuart suggested before me, create a second Cloud Project, set as startup, run that.

  • Similar to above, create a second project, but don't worry about startup. You can right click on any project, go to Debug and select start w/ debugging and achieve what F5 does without binding F5 to this solution

If you dont need to test azure-specifics (ie you are just testing the role)

  • Right click on the role's project, Debug, Start with Debugging This way the whole solution remains intact and you are just testing the logic


I think you can do this by:

  • create a new Azure Cloud Project within your solution
  • add just the one worker role to that cloud project
  • set that cloud project as your startup project

This will single out just the worker you are interested in


An easier solution would be to open the ServiceConfiguration.cscfg file, and set the "Instances > Count" property to "0", for all the roles that you don't want running (this only works in the compute-emulator, and NOT on the azure cloud).

That way, you keep your solution intact and your configurations safe, while just omitting them from the compute-emulator during run-time.