If we attempt to edit a page by clicking on the pencil icon or the edit page option through the page menu we receive the following error
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>An error occurred when trying to create a controller of type 'ControlBarController'. Make sure that the controller has a parameterless public constructor.</ExceptionMessage>
<ExceptionType>System.InvalidOperationException</ExceptionType>
<StackTrace> at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) at System.Web.Http.Tracing.Tracers.HttpControllerActivatorTracer.<>c__DisplayClass2.<System.Web.Http.Dispatcher.IHttpControllerActivator.Create>b__0() at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEnd(ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Action execute, Action`1 endTrace, Action`1 errorTrace) at System.Web.Http.Tracing.Tracers.HttpControllerActivatorTracer.System.Web.Http.Dispatcher.IHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType) at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request) at System.Web.Http.Tracing.Tracers.HttpControllerDescriptorTracer.<>c__DisplayClass2.<CreateController>b__0() at System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEnd(ITraceWriter traceWriter, HttpRequestMessage request, String category, TraceLevel level, String operatorName, String operationName, Action`1 beginTrace, Action execute, Action`1 endTrace, Action`1 errorTrace) at System.Web.Http.Tracing.Tracers.HttpControllerDescriptorTracer.CreateController(HttpRequestMessage request) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace>
<InnerException>
<ExceptionMessage>Exception has been thrown by the target of an invocation.</ExceptionMessage>
<ExceptionType>System.Reflection.TargetInvocationException</ExceptionType>
<StackTrace> at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance[T]() at DotNetNuke.Framework.ServiceLocator`2.InitInstance() at System.Lazy`1.CreateValue() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value() at lambda_method(Closure , ServiceProviderEngineScope ) at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1& activator) at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)</StackTrace>
<ExceptionMessage>The type initializer for 'DotNetNuke.ExtensionPoints.ExtensionPointManager' threw an exception.</ExceptionMessage>
<ExceptionType>System.TypeInitializationException</ExceptionType>
<StackTrace> at DotNetNuke.ExtensionPoints.ExtensionPointManager.ComposeParts(Object[] attributeParts) at DotNetNuke.Web.Components.Controllers.ControlBarController..ctor()</StackTrace>
<ExceptionMessage>Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</ExceptionMessage>
<ExceptionType>System.IO.FileNotFoundException</ExceptionType>
<StackTrace> 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.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.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) at Microsoft.Internal.AttributeServices.GetAttributes[T](ICustomAttributeProvider attributeProvider) at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog() at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at DotNetNuke.ExtensionPoints.SafeDirectoryCatalog..ctor(String directory) at DotNetNuke.ExtensionPoints.ExtensionPointManager.InitializeMefCompositionContainer() at DotNetNuke.ExtensionPoints.ExtensionPointManager..cctor()</StackTrace>
</InnerException>
</Error>
We have attempted to remove all modules referencing version 5.0.0.0 of System.Runtime.CompilerServices.Unsafe.dll and we have attempted editing the web.config of our site to reference version 5.0.0.0 of System.Runtime.CompilerServices.Unsafe.dll after copying version 5.0.0.0 of the System.Runtime.CompilerServices.Unsafe.dll, but the error persists.
We have resterted the site multiple times and cleared the cache. Any help anyone could provide would be greatly appreciated. Thank you.
I had the same error. It turned out to be references from other libraries we created for our modules. Once I changed the references on those projects to make sure they were all referencing versions that are the same as DNN does, then I restored all of the DLLs that come from a base DNN install, then copy in our libraries and references but without replacing any existing files in the DNN bin folder, then everything worked and no more System.Runtime 5.0 errors.
That's fantastic advice... It's important to keep your references, .NET framework, and API endpoints all regularly updated to prevent unforeseen issues in the future. :)
By the way, I just discovered a "hacky" way to get the edit bar when this happens.
That got me back in! :)
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.