在几秒钟内运行应用程序后,Asp.net核心2和角度4发生此错误

角度CLI:

Angular CLI: 1.7.0
Node: 6.11.3
OS: win32 x64
Angular: 4.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, tsc-wrapped

@angular/cli: 1.7.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.5.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.3.4
webpack-hot-middleware: 2.18.2`enter code here`
webpack-merge: 4.1.0
webpack: 2.5.1

app.shared.module:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';

import { AppComponent } from './components/app/app.component';
import { NavMenuComponent } from './components/navmenu/navmenu.component';
import { HomeComponent } from './components/home/home.component';
import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
import { CounterComponent } from './components/counter/counter.component';
import { VehicleFormComponent } from './components/vehicle-form/vehicle-form.component';

@NgModule({
    declarations: [
        AppComponent,
        NavMenuComponent,
        CounterComponent,
        FetchDataComponent,
        HomeComponent,
        VehicleFormComponent
    ],
    imports: [
        CommonModule,
        HttpModule,
        FormsModule,
        RouterModule.forRoot([
            { path: '', redirectTo: 'home', pathMatch: 'full' },
            { path: 'vehicles/new', component: VehicleFormComponent },
            { path: 'home', component: HomeComponent },
            { path: 'counter', component: CounterComponent },
            { path: 'fetch-data', component: FetchDataComponent },
            { path: '**', redirectTo: 'home' }
        ])
    ]
})
export class AppModuleShared {
}

输出错误:

[at-loader]中的错误./ClientApp/app/components/app/app.component.ts:3:12 TS2345:类型'{selector:string;模板:{}; styles:{} []; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 . [at-loader]中的错误./ClientApp/app/components/counter/counter.component.ts:3:12 TS2345:类型'{selector:string;模板:{}; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 . [at-loader]中的错误./ClientApp/app/components/fetchdata/fetchdata.component.ts:4:12 TS2345:类型'{selector:string;模板:{}; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 . [at-loader]中的错误./ClientApp/app/components/home/home.component.ts:3:12 TS2345:类型'{selector:string;模板:{}; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 . [at-loader]中的错误./ClientApp/app/components/navmenu/navmenu.component.ts:3:12 TS2345:类型'{selector:string;模板:{}; styles:{} []; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 . [at-loader]中的错误./ClientApp/app/components/vehicle-form/vehicle-form.component.ts:3:12 TS2345:类型'{selector:string;模板:{}; styles:{} []; }'不能分配给'Component'类型的参数 . 属性“模板”的类型不兼容 . 类型'{}'不能指定为'string |类型未定义” . 类型“{}”不能指定为“string”类型 .

错误图片:

Bug Feature