Info: Could not load file or assembly ‘PortableEngine, Version=…'
Problem reported by Cem Alacayir - June 19 at 2:57 AM
Employee Post
If you see this error, you probably have Glimpse in your project and this is a side-effect of Glimpse.
For fixing it; add this setting to your web.config:
	<add key="Glimpse:DisableAsyncSupport" value="true" />
If you don't have Glimpse, find AssemblyResolver.log for more details on why assembly loading may have failed:
  • If you were running on IIS, go to folder:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\APPNAME\fb52cde5\AssemblyUltimate\

    If IIS worker process is running in 32-bit mode (when "Enable 32-bit applications" option is checked for the application pool), go to folder:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\APPNAME\fb52cde5\AssemblyUltimate\
  • If you were running on Visual Studio, go to folder:
    %UserProfile%\AppData\Local\Temp\Temporary ASP.NET Files\vs\f3617516\AssemblyUltimate
Yellow highlighted folder names will be different. If you are not sure which folder it is, just go to parent "Temporary ASP.NET Files" folder and search for AssemblyResolver.log
For example when the error is caused by Glimpse, you will see an error like this in AssemblyResolver.log:
Received AssemblyResolve event -> Failed resolving assembly:
 Assembly Name:
 PortableEngine, Version=, Culture=neutral, PublicKeyToken=a6f3cafa178e6038
 Requesting Assembly:
 System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> _fXg: The C++ module failed to load while attempting to initialize the default appdomain.
  ---> System.NotSupportedException: Some environments conflict with current Glimpse async support. Please set Glimpse:DisableAsyncSupport = true in Web.config, or see https://github.com/Glimpse/Glimpse/issues/632 for more details.
 Server stack trace: 
	at Glimpse.AspNet.AspNetFrameworkProvider.AntiSerializationWrapper`1.GetObjectData(SerializationInfo info, StreamingContext context)
	at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
	at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
	at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
	at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
	at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize)
	at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage..ctor(IMethodCallMessage mcm)
	at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.SmuggleIfPossible(IMessage msg)
	at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

1 Reply

Reply to Thread
Cem Alacayir Replied
October 12 at 4:54 AM
Employee Post
FYI, DocumentUltimate v3.6.0 (October 12, 2017) fixes this error:

Fixed: The below error which happened in some environments:

The type initializer for '_UXg' threw an exception. ---> Could not load file or assembly 'PortableEngine, Version=, Culture=neutral, PublicKeyToken=a6f3cafa178e6038' or one of its dependencies.

The error happened either:

  • When ASP.NET impersonation was used via <identity impersonate="true" /> tag in web.config

  • When Glimpse library (diagnostics & insights library) was used in the project.

In both cases, the error is now fixed.

So you should not need the above workarounds.

Reply to Thread