2014-08-29 4 views
0

breeze.js 서버 측 asp.net web api를 사용하여 기본 설정을 수행하려고합니다. 2. breeze 라우트 설정과 breeze-annotated web API 컨트롤러가 있습니다. 메타 데이터 작업 (또는 해당 작업에 대한 작업)을 호출하면 아래에이 오류가 발생합니다. 내가 말할 수있는 한 내 실체에 대한 탐색 속성의 느린 로딩과는 아무 관련이 없습니다.Breeze.js WebApi 2 시작 문제

이 오류는 아마도 breeze 데이터 구조의 내부에서 느슨한 유형 인 것 같습니다. Breeze.ContextProvider.EF6과 함께 Breeze.WebApi2 및 Breeze.ContextProvider v1.4를 참조합니다.

breeze 설명서마다 db 컨텍스트에서 명시 적으로 지연로드를 비활성화했습니다. dbContext.Configuration.LazyLoadingEnabled = false;
dbContext.Configuration.ProxyCreationEnabled = false;

감사합니다.

ValueFactory attempted to access the Value property of this instance.","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Lazy`1.CreateValue() 
    at System.Lazy`1.LazyInitValue() 
    at System.Lazy`1.get_Value() 
    at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.GetControllerMapping() at System.Web.Http.Routing.AttributeRoutingMapper.AddRouteEntries(SubRouteCollection collector, HttpConfiguration configuration, IInlineConstraintResolver constraintResolver, IDirectRouteProvider directRouteProvider) 
    at System.Web.Http.Routing.AttributeRoutingMapper.<>c__DisplayClass2.<>c__DisplayClass4.<MapAttributeRoutes>b__1() 
    at System.Web.Http.Routing.RouteCollectionRoute.EnsureInitialized(Func`1 initializer)\r\n at System.Web.Http.Routing.AttributeRoutingMapper.<>c__DisplayClass2.<MapAttributeRoutes>b__0(HttpConfiguration config) 
    at System.Web.Http.HttpConfiguration.ApplyControllerSettings(HttpControllerSettings settings, HttpConfiguration configuration) 
    at System.Web.Http.Controllers.HttpControllerDescriptor.InvokeAttributesOnControllerType(HttpControllerDescriptor controllerDescriptor, Type type) 
    at System.Web.Http.Controllers.HttpControllerDescriptor.Initialize() 
    at System.Web.Http.Controllers.HttpControllerDescriptor..ctor(HttpConfiguration configuration, String controllerName, Type controllerType) 
    at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.InitializeControllerInfoCache()\r\n 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 System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request) 
    at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"} 

답변

1

경로가 등록되는 순서와 관련이 있습니다. Breeze Nuget에서 추가 한 webactivor.PreApplicationStartMethod() 어셈블리 지시문을 제거하고 Global.asax에서 Breeze 라우트 구성에 수동으로 호출했습니다. 표준 웹 API 라우트가 구성되어 작동을 시작한 후 수동으로 호출되었습니다. 이전에 설정하면 문제가 발생합니다.