I created a DLL that will collect information from AssemblyInfo.cs. In the class constructor, I use Reflection to get the topmost application that works.
public class AppInfo()
{
public AppInfo()
{
System.Reflection.Assembly assembly =
System.Reflection.Assembly.GetEntryAssembly();
if (assembly == null)
assembly = System.Reflection.Assembly.GetCallingAssembly();
}
}
How is it supposed to be used if I call it from any DLL in this MyApp application, which allows me to say that the name will always be "MyApp". Getting this information is not a problem, and it works great in Windows Services and Windows Applications. My question is:
How to get the assembly of the topmost website?
, Global.asax.cs, AssemblyInfo.cs - App_Code . Option AssemblyInfo.cs
<compiler
language="c#;cs;csharp"
extension=".cs"
compilerOptions="C:\Sandbox\MyWebSite\AssemblyInfo.cs"
type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
, AssemblyInfo.cs - System.Reflection.Assembly.GetExecutingAssembly(). AppInfo, Assembly , DLL, MyWebSite, new AppInfo(), DLL -.
, - -, , , , -. , AssemblyInfo.cs -, , , DLL ?
EDIT: -, Windows Windows