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()
.
Eventually, I found the solution:
Add a cloud service project to the solution
I had to edit the project file of my class library and add this: <RoleType>Worker</RoleType>
to the first <PropertyGroup>
element.
In addition to that, my service entry point class had to extend RoleEntryPoint
.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With