Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn existing class library into worker role

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().

like image 857
Uri Abramson Avatar asked Aug 28 '13 08:08

Uri Abramson


2 Answers

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.

like image 125
Uri Abramson Avatar answered Sep 21 '22 04:09

Uri Abramson


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.

like image 29
sharptooth Avatar answered Sep 21 '22 04:09

sharptooth