DNN exception on Site Settings or Host Settings pages "Could not load file or assembly 'protobuf-net"

StackOverflow https://stackoverflow.com/questions/20495359

  •  31-08-2022
  •  | 
  •  

Question

I upgraded my DNN from version 7.0.0 to 7.1.1. After that I'm getting an exception every time that I enter page Site Settings or Host Settings of DNN in my site. The exception is:

Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified.

Here is the full Inner Exception:

DotNetNuke.Services.Exceptions.PageLoadException: Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified. 
---> System.IO.FileNotFoundException: Could not load file or assembly 'protobuf-net, Version=2.0.0.447, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The system cannot find the file specified. 
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) 
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) 
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) 
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) 
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) 
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable) 
at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit) 
at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement origin) 
at System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal() 
at DotNetNuke.ExtensionPoints.SafeDirectoryCatalog..ctor(String directory) 
at DotNetNuke.ExtensionPoints.ExtensionPointManager.get_MefCompositionContainer() 
at DotNetNuke.ExtensionPoints.ExtensionPointManager.ComposeParts(Object[] attributeParts) 
at DotNetNuke.ExtensionPoints.EditPagePanelExtensionControl.OnInit(EventArgs e) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Control.InitRecursive(Control namingContainer) 
at System.Web.UI.Control.AddedControl(Control control, Int32 index) 
at System.Web.UI.Control.EnsureChildControls() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Control.PreRenderRecursiveInternal() 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

I have already searched everything about protobuf-net and DNN but I have not found anything.

Anyone know anything about it?

EDIT

Finally, problem solved. The problem was a module that I installed that reference the protobuf-net. The module calls ZeneXa Newsletter Autoresponder. Somehow this module is not compatible with DNN versions newer than 7.0.0. I contacted the module for more information about that.

Was it helpful?

Solution

I have absolutely no knowledge of how DNN is making use of this, but at the simplest level you could try adding a reference to an appropriate version of protobuf-net (probably from NuGet is the simplest), and see if it works. This can be done via the UI or in the package manager console:

PM> Install-Package protobuf-net

If the problem is actually "fusion", then a binding redirect may help - for example, to redirect everything to r668 (assuming you are using protobuf-net r668):

<dependentAssembly>
  <assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67"
                    culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-2.0.0.668" newVersion="2.0.0.668" />
</dependentAssembly>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top