title: Detecting if I'm running in SharePoint
body: <p>Is there a way for my ASP.net Application to know if it's running within SharePoint (2010), but without referencing SharePoint Assemblies? (So I can't just check if SPContext.Current is null).</p>
  
  <p>I wonder if it's viable to get all Assemblies that are loaded by name? So if I see that my AppDomain contains a Microsoft.SharePoint assembly then I know I'm in SharePoint.</p>
  
  <p>Use case: The Assembly runs outside of SharePoint as well, but referencing SharePoint DLLs requires to deploy them (not possibly due to licensing) or getting Exceptions when I access a SharePoint method.</p>
  
  <p>At the moment I use conditional compilation, but I'd like to get away from that and use a DI-mechanism to choose one of two classes, depending if I'm in SharePoint.</p>