Build error trying to implement custom error pages for MVC and Feather
When following along the below knowlege base article I receive a build error for the SitefinityWebApp.dll.
Here is the error:
System.SystemException: Unable to load assembly 'SitefinityWebApp, Version=8.2.5900.0, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'Telerik.Sitefinity, Version=8.2.5900.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500) ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
--- End of inner exception stack trace ---
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.ReadMetaModel(Assembly assembly)
at Telerik.OpenAccess.Metadata.AttributesMetadataSource.<>c__DisplayClass1.<FromAssembly>b__0()
at Telerik.OpenAccess.Metadata.AttributesMetadataSource.CreateModel()
at Telerik.OpenAccess.Metadata.MetadataSource.GetModelCore(MetadataContainer old)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()
I have looked at all my references and just am not seeing what is getting in the way.
Here is my code:
using
System.Web;
using
Telerik.Microsoft.Practices.Unity;
using
Telerik.Sitefinity.Abstractions;
using
Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Routing;
using
Telerik.Sitefinity.Mvc;
using
Telerik.Sitefinity.Services;
namespace
SitefinityWebApp
public
class
FeatherActionInvokerCustom : FeatherActionInvoker
protected
override
void
RestoreHttpContext(
string
output, HttpContext initialContext)
this
.PopulateResponseStatus(System.Web.HttpContext.Current, initialContext);
base
.RestoreHttpContext(output, initialContext);
private
void
PopulateResponseStatus(HttpContext httpContext, HttpContext initialContext)
if
(!SystemManager.IsDesignMode && httpContext.Response.StatusCode != 200)
initialContext.Response.Status = httpContext.Response.Status;
initialContext.Response.StatusCode = httpContext.Response.StatusCode;
initialContext.Response.StatusDescription = httpContext.Response.StatusDescription;
internal
static
void
Register()
ObjectFactory.Container.RegisterType<IControllerActionInvoker, FeatherActionInvokerCustom>();
Hi
Are you using the NuGet packages and the OA enhancer?
Are you using the enhancer yourself and do you have custom modules built with Thunder?
The issue is most probably caused by the OpenAccess enhancer.
Please, unload the project and edit the .csproj. Comment or remove the enhancer import:
<
Import
Project
=
"OpenAccessNuget.targets"
/> to
<!--<Import Project="OpenAccessNuget.targets" />-->
Yes, I am using NuGet packages. I am not actively or knowingly using OA enhancer and I have not used Thunder on this project.
Removing the import reference from my project file allowed me to build and so far testing looks good in that I am seeing a proper 404 status returned when I expect it.
Are there any repercussions you can think of with me disabling OA enhancer?
Hi
If you are not using the enhancer to enhance custom modules (built with Thunder and not recommended) you should not have any problems.
Regards,
Nikola Zagorchev
Telerik