I have windows 8.1 x64, Visual Studio 2012 x86, IIS 8.5.
I have Wcf Service Host project (contains svc file)
<%@ ServiceHost Language="C#" Debug="true" Service="WcfServiceImplementation.MyService" %>
I have Wcf Service implementation project.
Wcf Service hosted in IIS
I have 2 assemblies: WcfService.Host.dll and WcfServiceImplementation.dll
This code in WcfServiceImplementation.dll:
1)
Assembly.GetEntryAssembly()
gets null.
2)
Assembly.GetExecutingAssembly()
gets WcfServiceImplementation.
3)
Assembly.GetCallingAssembly()
gets System.ServiceModel.
How can I get Service.Host assembly location programatically in the code that execute WcfServiceImplementation assembly?
In general, for any Wcf Service or Web Application, how get the "main assembly" (the wcf service host, the web application) ?
My trace (log):
ProcessName: w3wp
Is64BitOperatingSystem: True
Is64BitProcess: True
SystemConfigurationFile: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config
ConfigurationFile: C:\TFS\Tests\WcfService\web.config
MainModule.FileName: c:\windows\system32\inetsrv\w3wp.exe
MainModule.ModuleName: w3wp.exe
BaseDirectory: C:\TFS\Tests\WcfService\
ApplicationBase: C:\TFS\Tests\WcfService\
FriendlyName: /LM/W3SVC/2/ROOT-5-130404032112324911
ApplicationName: c36153ea
Code in WcfServiceImplementation assembly:
Assembly.GetEntryAssembly():
GetAssemblyExtendedData. Assembly null
Assembly.GetExecutingAssembly():
Location: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2090c609\c36153ea\assembly\dl3\92d3ec19\b0fa1582_c649cf01\WcfServiceImplementation.dll
ProcessorArchitecture: MSIL
Assembly.GetCallingAssembly():
Location: C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll
ProcessorArchitecture: MSIL
Suggestions ?