Angular 2 上的 403 错误使用 angular-cli 和 IIS 7.5 生成的网站

403 Error on Angular 2 Website that is generated using angular-cli and IIS 7.5

我的网站是由 angular-cli 工具创建的。它在本地主机上工作得很好。但是,当我将它部署到 IIS 7.5 时,它会给我 403 错误。我所做的是在同一个文件夹中部署另一个 angular 2 网站,但没有使用 cli 工具,它成功了。所以我想我没有权限错误。由 cli 工具生成的 angular 2 个网站中的 none 在 IIS 7.5 上无法正常工作。下面是我的 package.json 文件。

{
  "name": "myauthapp",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "ng": "ng",
     "start": "ng serve",
      "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-       check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
       "test": "ng test",
       "pree2e": "webdriver-manager update --standalone false --gecko    false",
       "e2e": "protractor"
   },
      "private": true,
       "dependencies": {
      "@angular/common": "^2.3.1",
      "@angular/compiler": "^2.3.1",
       "@angular/core": "^2.3.1",
       "@angular/forms": "^2.3.1",
       "@angular/http": "^2.3.1",
       "@angular/platform-browser": "^2.3.1",
       "@angular/platform-browser-dynamic": "^2.3.1",
       "@angular/router": "^3.3.1",
       "angularfire2": "^2.0.0-beta.7",
       "core-js": "^2.4.1",
       "firebase": "^3.6.5",
       "rxjs": "^5.0.1",
       "ts-helpers": "^1.1.1",
       "zone.js": "^0.7.2"
    },
      "devDependencies": {
       "@angular/compiler-cli": "^2.3.1",
       "@types/jasmine": "2.5.38",
       "@types/node": "^6.0.42",
       "angular-cli": "1.0.0-beta.25.5",
       "codelyzer": "~2.0.0-beta.1",
       "jasmine-core": "2.5.2",
        "jasmine-spec-reporter": "2.5.0",
        "karma": "1.2.0",
        "karma-chrome-launcher": "^2.0.0",
        "karma-cli": "^1.0.1",
        "karma-jasmine": "^1.0.2",
        "karma-remap-istanbul": "^0.2.1",
        "protractor": "~4.0.13",
        "ts-node": "1.2.1",
        "tslint": "^4.3.0",
        "typescript": "~2.0.3"
      }
   }

我还是不知道为什么angular-cli会出现这个问题。但简单的解决方案是 运行 ng build 命令。它创建了一个 dist 文件夹。 IIS网站源也应该指向dist文件夹。