I have MySolution.MyLibrary
class library which I register in MySolution.MyService
WCF service using SimpleInjector:
container.Register<IMyLibrary, MyLibrary>(LifeStyle.Singleton);
I need to get the name of the main assembly, MySolution.MyService
, in the constructor of MySolution.MyLibrary
. I've tried Assembly.* methods but I couldn't manage to do it. Any ideas how I can get the name?
These are what I've tried:
Assembly.GetExecutingAssembly().GetName().FullName
"MySolution.MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Assembly.GetCallingAssembly().GetName().FullName
"Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
Assembly.GetEntryAssembly()
null