Frage

Is there a way to turn an existing class library into a worker role? I don't want to add more projects to the solution especially when this project will only call MyLibrary.Class.Run().

War es hilfreich?

Lösung

Eventually, I found the solution:

  1. Add a cloud service project to the solution

  2. I had to edit the project file of my class library and add this: <RoleType>Worker</RoleType> to the first <PropertyGroup> element.

  3. In addition to that, my service entry point class had to extend RoleEntryPoint.

  4. Once this is done, right click no the Roles folder in the cloud service project and choose Add -> Worker role project in solution and choose my Class Library.

That's it.

Andere Tipps

You'll have to add a "cloud service" project (.ccproj) anyway. Then you can include a RoleEntryPoint descendant to the project which you select as worker role payload (you do that when you add a new role to the cloud service project) and it should work.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top