문제

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:

  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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top