1
Vote

Phalanger searching in IIS exe dir instead of bin

description

I've pasted both the error and the binding log below - it looks like, on win 8 and 2012 machines, that phalanger is not searching in a sites bin directory for DLL's but rather the location of the IIS exe. The same behavior happens in IIS Express.

Here’s the error generated:
ERROR Global HttpApplication Error Handler Catch.
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'Parabola.Web.Site, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.get_Id()
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie)
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* )
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
at .cctor()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at PHP.Core.Externals.InitCollocation()
at PHP.Core.Externals.InitializeExtMans()
at PHP.Core.Externals.LocalExtMan(ExtSupportVersion extversion)
at PHP.Core.Externals.<get_LocalExtMans>d__0.MoveNext()
at PHP.Core.Externals.EndRequest()
at PHP.Core.RequestContext.FinallyDispose()
at PHP.Core.RequestContext.Dispose()
at PHP.Core.RequestHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



And here’s the binding log:
*** Assembly Binder Log Entry (9/24/2013 @ 2:24:54 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Windows\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = bpecloud\svc_products
LOG: DisplayName = Parabola.Web.Site, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Windows/SysWOW64/inetsrv/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = w3wp.exe

Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site/Parabola.Web.Site.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site.EXE.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site/Parabola.Web.Site.EXE.
LOG: All probing URLs attempted and failed.

*** Assembly Binder Log Entry (9/24/2013 @ 2:24:54 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Windows\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = bpecloud\svc_products
LOG: DisplayName = Parabola.Web.Site, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Windows/SysWOW64/inetsrv/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = w3wp.exe

Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site/Parabola.Web.Site.DLL.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site.EXE.
LOG: Attempting download of new URL file:///C:/Windows/SysWOW64/inetsrv/Parabola.Web.Site/Parabola.Web.Site.EXE.
LOG: All probing URLs attempted and failed.

comments

jakub wrote Oct 7, 2013 at 10:10 AM

Very weird coincidence. This happens while loading extension support which is in GAC, and has nothing to do with user's assemblies. AND it happens at the end of the request.

In this case .NET is loading relatively to executing assembly, system directory and GAC.

What native extensions do you use?

bryceashey wrote Jul 9, 2014 at 9:28 PM

Well it took almost a year to run across something related and dig in more but this might be relevant: http://msdn.microsoft.com/en-us/library/dn458353(v=vs.110).aspx

I ran into almost the same exception when setting information on the RequestContext.

Kind Regards,
B

bryceashey wrote Jul 9, 2014 at 9:29 PM

Sorry make that "CallContext" not RequestContext...