Web Api for Self-Hosting and Web-Hosting?

Is there a recommended practise for supporting self-hosting and web-hosting simultaneously?

I had a lot of issues to work through. Because HttpContext.Current is not set and The GlobalConfiguration is not accessible in self-hosting, autofac does not work properly.

Are there any other issues to be aware of?