【发布时间】:2019-05-18 19:35:18
【问题描述】:
我正在 Visual Studio 2017 中运行带有 Angular 的 ASP.NET Core 应用程序。不幸的是,每当我运行该项目时,它都会在浏览器中显示以下消息:
Cannot GET /
谷歌搜索了几个小时 (Sample Link),我尝试了以下操作,并在 tsconfig.json 文件中添加:
"lib": [ "es5", "es6", "es2017", "dom" ]
在我的情况下,更早的情况如下:
"lib": [ "es2017" ]
虽然项目搭建成功,但也很少出现如下错误:
Severity Code Description Project File Line Suppression State
Error TS2583 (TS) Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\@angular\common\src\directives\ng_class.d.ts 48 Active
Severity Code Description Project File Line Suppression State
Error TS2583 (TS) Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\@angular\core\src\change_detection\differs\default_keyvalue_differ.d.ts 24 Active
Severity Code Description Project File Line Suppression State
Error TS2585 (TS) 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. ASP.NETCoreWithAngular C:\Users\Amit's-PC\source\repos\ASP.NETCoreWithAngular\ASP.NETCoreWithAngular\ClientApp\node_modules\rxjs\Observable.d.ts 58 Active
我在这里错过了什么?任何想法将不胜感激。
【问题讨论】:
标签: asp.net angular asp.net-core