2012-06-13 6 views
1

기존 MVC 프로젝트에 장점을 추가하려고합니다. 라인UpshotContext에서 DataSource() 호출 중 예외가 발생했습니다.

@(Html.UpshotContext().DataSource<DataServiceController>(x => x.GetAllProducts())) 

내가 예외를 설치 nuget 패키지의

Could not load file or assembly 'System.Web.Http.Common, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 
The system cannot find the file specified. 

내 목록을 받고 있어요

<packages> 
    <package id="AspNetMvc" version="4.0.20505.0" /> 
    <package id="AspNetWebApi" version="4.0.20505.0" /> 
    <package id="AspNetWebApi.Data" version="4.0.20221.15125" /> 
    <package id="EntityFramework" version="4.3.1" /> 
    <package id="jQuery" version="1.7.2" /> 
    <package id="jQuery.Ajax.Unobtrusive" version="2.0.20505.0" /> 
    <package id="jQuery.UI.Combined" version="1.8.20" /> 
    <package id="jQuery.Validation" version="1.9" /> 
    <package id="jQuery.Validation.Unobtrusive" version="2.0.20505.0" /> 
    <package id="knockoutjs" version="2.1.0" /> 
    <package id="Microsoft.AspNet.Mvc" version="4.0.20505.0" /> 
    <package id="Microsoft.AspNet.Razor" version="2.0.20505.0" /> 
    <package id="Microsoft.AspNet.WebApi" version="4.0.20505.0" /> 
    <package id="Microsoft.AspNet.WebApi.Client" version="4.0.20505.0" /> 
    <package id="Microsoft.AspNet.WebApi.Core" version="4.0.20505.0" /> 
    <package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20505.0" /> 
    <package id="Microsoft.AspNet.WebPages" version="2.0.20505.0" /> 
    <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="2.0.20505.0" /> 
    <package id="Microsoft.jQuery.Unobtrusive.Validation" version="2.0.20505.0" /> 
    <package id="Microsoft.Net.Http" version="2.0.20505.0" /> 
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" /> 
    <package id="Modernizr" version="2.5.3" /> 
    <package id="Newtonsoft.Json" version="4.5.7" /> 
    <package id="Ninject" version="3.0.1.10" /> 
    <package id="Ninject.MVC3" version="3.0.0.6" /> 
    <package id="Ninject.Web.Common" version="3.0.0.7" /> 
    <package id="SinglePageApplication" version="4.0.20221.15125" /> 
    <package id="Upshot" version="1.0.0.2" /> 
    <package id="WebActivator" version="1.5.1" /> 
</packages> 

구글이 나에게 그 예외에 대한 아무것도 제공하지 않습니다. 어떤 아이디어?

편집 :

[FileNotFoundException: Could not load file or assembly 'System.Web.Http.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.] 
    System.Web.Http.Data.Metadata.MetadataProviderAttribute..ctor(Type providerType) +0 
    System.Web.Http.Data.EntityFramework.Metadata.DbMetadataProviderAttribute..ctor() +77 
    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) +1539 
    System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +161 
    System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) +58 
    System.Web.Http.Data.DataControllerDescription.CreateMetadataProvider(Type dataControllerType) +455 
    System.Web.Http.Data.DataControllerDescription.CreateDescription(HttpControllerDescriptor controllerDescriptor) +134 
    System.Web.Http.Data.<>c__DisplayClass1.<GetDescription>b__0(Type type) +42 
    System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +62 
    System.Web.Http.Data.DataControllerDescription.GetDescription(HttpControllerDescriptor controllerDescriptor) +158 
    System.Web.Http.Data.Helpers.MetadataExtensions.Metadata(HtmlHelper htmlHelper) +215 

[TargetInvocationException: Exception has been thrown by the target of an invocation.] 
    System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 
    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92 
    System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +110 
    System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19 
    System.Web.Http.Data.Helpers.UpshotConfigBuilder.GetMetadata(Type dataControllerType) +233 
    System.Web.Http.Data.Helpers.UpshotConfigBuilder.ToHtmlString() +360 
    System.Web.HttpUtility.HtmlEncode(Object value) +38 
    System.Web.WebPages.WebPageBase.Write(Object value) +68 
    ASP._Page_Views_Search_Index_cshtml.Execute() in c:\code\Website\Views\Search\Index.cshtml:11 
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197 
    System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +97 
    System.Web.WebPages.StartPage.RunPage() +17 
    System.Web.WebPages.StartPage.ExecutePageHierarchy() +62 
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76 
    System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +260 
    System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115 
    System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +295 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13 
    System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242 
    System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177 
    System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +89 
    System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57 
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43 
    System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 
    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47 
    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 
    System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__4(IAsyncResult asyncResult) +25 
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23 
    System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 
    System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48 
    System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7 
    System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 
    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9615056 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 

답변

2

this 스레드 : 전체 스택 추적이 소용 될 줄 알았는데 현재 SPA (베타) 아니다 MVC와 호환 4 RC

ASP.NET 팀은 MVC4 베타 + SPA Nuget 패키지를 사용하도록 권장합니다. ing. 대안으로는 충돌 라이브러리에 대한 코드를 가져 와서 직접 빌드하는 방법을 제안하지만 팀이 앞으로 나아갈 때 두통과 재 작업을 요구하는 것입니다.

+0

대단히 감사합니다. 나는 조금 더 갈 준비가 될 때까지 그냥 내버려 둘 것 같아. – Greg

+0

아마 좋은 생각이야. 실험을 원할 경우 항상 베타 버전이 설치된 VM을 만들 수 있으며 최종 출시를 앞두고 시작할 수 있습니다. – JRoughan

-1

NuGet에서를 설치하십시오 : 토론으로 당

PM> Install-Package System.Web.Http.Common 
+0

미안하지만, 나는 말해야했습니다. 나는 그것을 시도했지만 RouteParameter는 System.Web.Http.Common과 Microsoft.AspNet.WebApi.Core에 정의되어있다. 그 오류로 인해 system.web.http.common은 쓸모없는 누에콩 패키지라고 믿게되었습니다. – Greg