title: Get web application assembly name, regardless of current executing assembly
body: <p>Is is possible to get the assembly name of an ASP.NET web application, from a referenced assembly??</p>
  
  <p>Assembly.GetEntryAssembly worked fine in desktop and console apps but it seems to be always null in web apps, and GetExecuting\GetCallingAssebly return my referenced assembly, not the one from the web app.</p>
  
  <hr>
  
  <p>Long explanation:</p>
  
  <p>I wrote a custom <a href="http://msdn.microsoft.com/en-us/library/system.configuration.settingsprovider.aspx" rel="noreferrer">Settings Provider</a>, that instead of reading configuration from the app config file, it gets the settings from a centralized configuration service.</p>
  
  <p>The custom provider is in a separate assembly so it can be used by the different applications.</p>
  
  <p>The <a href="http://msdn.microsoft.com/en-us/library/system.configuration.settingsprovider.applicationname.aspx" rel="noreferrer">ApplicationName</a> property needs to be overriden with the app assembly name.</p>
  
  <p>The way to use the provider is though a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.settingsproviderattribute.aspx" rel="noreferrer">.net custom attribute</a>, so I can't send any params to it.</p>
  
  <p>Since non of the Assembly.Get*Assembly methods seem to work, the only thing a I can think of is requiring an appSetting with the app name for web apps, but I'm not really happy with that. Any help with this is appreciated, thanks!</p>