问题
Let's say I have:
public abstract ServiceBase : RoleEntryPoint {
...
}
public MyRealService : RoleEntryPoint {
...
}
Will my Azure WorkerRole project be able to correctly figure out MyRealService class as the WorkerRole entry point?
This used to be working well for me but now that I've updated to Azure Tooling 2.0 it doesn't hit any breakpoint so I'm not even sure what entry point class it is loading.
回答1:
Problem solved. It basically had to do with some references pointing to the old 1.8.0.0 DLL and some to the 2.0.0.0.
So following the example above:
- ServiceBase: was defined in a different project that was depending on 1.8.0.0.
- MyRealService: was defined in the top-level project that depends on 2.0.0.0.
So since the base class inheriting from RoleEntryPoint was from an older version of Microsoft.WindowsAzure.ServiceRuntime, MyRealService class was never found despite the actual C# project depending on version 2.0.0.0 of Microsoft.WindowsAzure.ServiceRuntime.
Thanks so much to the answer in this thread: Azure WorkerRole Stopping Immediately After Starting
来源:https://stackoverflow.com/questions/19253015/will-azure-find-my-roleentrypoint-implementation-class-if-thats-the-direct-clas