Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ASP.NET核心预渲染错误(';deps';必需)_Angular_Single Page Application_Asp.net Core 2.0 - Fatal编程技术网

Angular ASP.NET核心预渲染错误(';deps';必需)

Angular ASP.NET核心预渲染错误(';deps';必需),angular,single-page-application,asp.net-core-2.0,Angular,Single Page Application,Asp.net Core 2.0,使用ASP.NET预渲染时,我在ASP.NET Core 2.0应用程序中遇到以下错误: NodeInvocationException: StaticInjectorError[{provide:PlatformLocation, useClass:ServerPlatformLocation}]: 'deps' required Error: StaticInjectorError[{provide:PlatformLocation, useClass:ServerPlatformLocat

使用ASP.NET预渲染时,我在ASP.NET Core 2.0应用程序中遇到以下错误:

NodeInvocationException: StaticInjectorError[{provide:PlatformLocation, useClass:ServerPlatformLocation}]: 'deps' required
Error: StaticInjectorError[{provide:PlatformLocation, useClass:ServerPlatformLocation}]: 'deps' required
在我的boot.server.ts中

import { platformDynamicServer, PlatformState, INITIAL_CONFIG } from '@angular/platform-server';
package.json

  "devDependencies": {
    "@angular/animations": "4.2.5",
    "@angular/common": "4.2.5",
    "@angular/compiler": "4.2.5",
    "@angular/compiler-cli": "4.2.5",
    "@angular/core": "4.2.5",
    "@angular/forms": "4.2.5",
    "@angular/http": "4.2.5",
    "@angular/platform-browser": "4.2.5",
    "@angular/platform-browser-dynamic": "4.2.5",
    "@angular/platform-server": "4.2.5",
    "@angular/router": "4.2.5",
    "@ngtools/webpack": "1.5.0",
    "@types/webpack-env": "1.13.0",
    "angular2-router-loader": "0.3.5",
    "angular2-template-loader": "0.6.2",
    "aspnet-prerendering": "^3.0.1",
    "aspnet-webpack": "^2.0.1",
    "awesome-typescript-loader": "3.2.1",
...
    "typescript": "2.4.1",
    "url-loader": "0.5.9",
    "webpack": "2.5.1",
    "webpack-hot-middleware": "2.18.2",
    "webpack-merge": "4.1.0",
...
  },
  "dependencies": {
    "ngx-cookie": "^2.0.1"
  }
有谁能帮我纠正这个错误吗?我应该在某处添加导入或提供条目吗?哪里
Thx.

为了让其他人知道,谁感兴趣,并感谢他们的帮助,我在这里发布了我克服这个问题的方法

svoychik与我分享了一个包含ngx cookie的入门项目

有了这个项目,作为一个起点,我现在就可以使用该服务了,但我无法告诉您为什么不能在VS2017的现有项目中实现它(从库存新项目ASP.NET网站模板生成)

作为参考,以下是我们的对话

祝你好运