Ran into a problem today, wanting to get the assembly that started the an application. Now this isn't a tricky problem just had to bend it to my will :)
We have a code-base shared across platforms (WPF & Silverlight) via project linker and we need the ability to get the executable assembly, MSDN describes this as 'the assembly that is the process executable in the default application domain' ans this is accessed via the GetEntryAssembly method.
The problem is purely because GetEntryAssembly is not supported in Silverlight so we had to come up with away to get the assembly version of the startup dll in the Silverlight XAP.
The following code is contained in a library (framework) assembly which know nothing about which assembly (executable) was loaded into the default application domain.
So I came up with the idea of using the Application.Current property:
We have a code-base shared across platforms (WPF & Silverlight) via project linker and we need the ability to get the executable assembly, MSDN describes this as 'the assembly that is the process executable in the default application domain' ans this is accessed via the GetEntryAssembly method.
The problem is purely because GetEntryAssembly is not supported in Silverlight so we had to come up with away to get the assembly version of the startup dll in the Silverlight XAP.
The following code is contained in a library (framework) assembly which know nothing about which assembly (executable) was loaded into the default application domain.
So I came up with the idea of using the Application.Current property:
Comments
Post a Comment