Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DT 4 posts 24 karma points
    Sep 10, 2013 @ 11:03
    DT
    0

    Umbraco 6.1 and Web Api 2 Bug

    Hi

    I'm trying to add Web Api 2 to my umbraco 6.1 project, but i get the following error when i Map the Http Attribute Routes.

    I think it's the buildin web api attributes for umbraco. Is there any solution for this problem?

    Value cannot be null.
    Parameter name: umbracoContext

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: umbracoContext

    Source Error: 

    Line 21:           );
    Line 22: 
    Line 23:          config.MapHttpAttributeRoutes();
    Line 24: 
    Line 25:            //config.Routes.MapHttpRoute(


    Source File: path....\App_Start\WebApiConfig.cs    Line: 23 

    Stack Trace: 

    [ArgumentNullException: Value cannot be null.
    Parameter name: umbracoContext]
       Umbraco.Web.WebApi.UmbracoAuthorizeAttribute..ctor(UmbracoContext umbracoContext) +89
       Umbraco.Web.WebApi.UmbracoAuthorizeAttribute..ctor() +21
       System.RuntimeTypeHandle.CreateCaInstance(RuntimeType type, IRuntimeMethodInfo ctor) +0
       System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1547
       System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +161
       System.RuntimeType.GetCustomAttributes(Boolean inherit) +40
       System.Web.Http.Controllers.HttpControllerDescriptor.InvokeAttributesOnControllerType(HttpControllerDescriptor controllerDescriptor, Type type) +67
       System.Web.Http.Controllers.HttpControllerDescriptor.InvokeAttributesOnControllerType(HttpControllerDescriptor controllerDescriptor, Type type) +55
       System.Web.Http.Controllers.HttpControllerDescriptor..ctor(HttpConfiguration configuration, String controllerName, Type controllerType) +105
       System.Web.Http.Dispatcher.DefaultHttpControllerSelector.InitializeControllerInfoCache() +390
       System.Lazy`1.CreateValue() +416
       System.Lazy`1.LazyInitValue() +152
       System.Lazy`1.get_Value() +75
       System.Web.Http.Dispatcher.DefaultHttpControllerSelector.GetControllerMapping() +14
       System.Web.Http.HttpConfigurationExtensions.MapHttpAttributeRoutes(HttpConfiguration configuration, HttpRouteBuilder routeBuilder) +96
       System.Web.Http.HttpConfigurationExtensions.MapHttpAttributeRoutes(HttpConfiguration configuration) +65
  • Sam Gooch 7 posts 27 karma points
    Dec 04, 2013 @ 12:45
    Sam Gooch
    0

    I too am experiencing this problem. It seems to be intermittent for me and an application recycle seems to fix it.

    Did you sort this?

Please Sign in or register to post replies

Write your reply to:

Draft