找不到包'Newtonsoft.Json'

时间:2017-12-12 03:03:27

标签: c# .net asp.net-mvc razor visual-studio-mac

使用Visual Studio for Mac(社区7.3),我试图从Lynda.com的“学习ASP.NET核心MVC”第3章运行示例项目,该第3章介绍了“使用Razor渲染HTML”。

我构建了find但是当我尝试在浏览器中加载时,我收到以下错误:

  

处理请求时发生未处理的异常。

     

InvalidOperationException:找不到编译库位置   包'Newtonsoft.Json'   Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()

     

堆栈查询Cookie标头InvalidOperationException:找不到   包'Newtonsoft.Json'的编译库位置   Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()   System.Linq.Enumerable + d__157.MoveNext()   Microsoft.AspNetCore.Mvc.Razor.Compilation.MetadataReferenceFeatureProvider.PopulateFeature(IEnumerable的   parts,MetadataReferenceFeature功能)   Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature(TFeature   特征)   Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.GetCompilationReferences()   System.Threading.LazyInitializer.EnsureInitializedCore(ref T.   target,ref bool initialized,ref object syncLock,Func   valueFactory)   Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.get_CompilationReferences()   Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService.Compile(RelativeFileInfo   fileInfo,string compilationContent)   Microsoft.AspNetCore.Mvc.Razor.Internal.CompilerCache.CreateCacheEntry(串   relativePath,string normalizedPath,Func compile)   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Mvc.Razor.Internal.CompilerCache.GetOrAdd(串   relativePath,Func编译)   Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRazorPageFactoryProvider.CreateFactory(串   relativePath)   Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet的   expirationTokens,string relativePath,bool isMainPage)   Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.OnCacheMiss(ViewLocationExpanderContext   expanderContext,ViewLocationCacheKey cacheKey)   Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromViewLocations(ActionContext中   actionContext,string pageName,bool isMainPage)   Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.FindView(ActionContext中   context,string viewName,bool isMainPage)   Microsoft.AspNetCore.Mvc.ViewEngines.CompositeViewEngine.FindView(ActionContext中   context,string viewName,bool isMainPage)   Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor.FindView(ActionContext中   actionContext,ViewResult viewResult)   Microsoft.AspNetCore.Mvc.ViewResult + d__26.MoveNext()   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker + d__32.MoveNext()   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker + d__31.MoveNext()   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker + d__29.MoveNext()   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker + d__23.MoveNext()   Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker + d__18.MoveNext()   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Builder.RouterMiddleware + d__4.MoveNext()   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)System.Runtime.CompilerServices.TaskAwaiter.GetResult()   ExploreCalifornia.Startup +<> c +< b__3_0> d.MoveNext()in   Startup.cs                   等待下一个(); System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware + d__6.MoveNext()

     

显示原始异常详情

0 个答案:

没有答案