2017-11-06 19 views
0

私は単純なWebアプリケーションを作成しました。ここでは、バックエンドは.net core 2.0で、フロントエンドはangular4で実行されています。 enter image description hereVisual StudioからAngular4を実行する

私のアプリケーションを起動したい場合は、cmdまたはpower shellを開いてnpm startを書きます。その瞬間にアプリケーションが起動し、ブラウザが開きます。

しかし、私はVSから+ F5または単にF5を使ってアプリケーションを実行したいと思うのですが、ブラウザが開いていてアプリケーションが起動していないと、npmが起動していません。ここ はpackage.json

{ 
    "version": "1.0.0", 
    "name": "mypackage", 
    "private": true, 

    "scripts": { 
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 
    "lite": "lite-server", 
    "tsc": "tsc", 
    "tsc:w": "tsc -w" 
    }, 
    "dependencies": { 
    "@angular/common": "^4.4.5", 
    "@angular/compiler": "^4.4.5", 
    "@angular/core": "^4.4.5", 
    "@angular/forms": "^4.4.5", 
    "@angular/http": "^4.4.5", 
    "@angular/platform-browser": "^4.4.5", 
    "@angular/platform-browser-dynamic": "^4.4.5", 
    "@angular/router": "^4.4.5", 
    "core-js": "^2.5.1", 
    "rxjs": "^5.4.3", 
    "systemjs": "^0.20.19", 
    "zone.js": "^0.8.18" 
    }, 
    "devDependencies": { 
    "@types/node": "^8.0.34", 
    "concurrently": "^3.5.0", 
    "lite-server": "^2.3.0", 
    "typescript": "^2.5.3" 
    } 
} 
+0

を実行しますですその特定の目的のための記事。ここをクリックしてください:https://medium.com/@faisalmuhammad/live-reloading-angular-application-with-asp-net-core-in-visual-studio-2017-957619f31008 – Faisal

+0

IIS上で展開する場合は、別の設定を管理する必要がありますか?私の場合、この解決法は機能しません。理由を理解する必要があります... –

答えて

0

からのコードは、私が書いた

ctrl + ` 

あなたvscodeでこれを試してみて、それが底部にターミナルのタブを開いて、今

npm start or npm run start 
+0

npm startを使いたくありません。 Visual Studioからデバッグモードでアプリケーションを実行したい –

関連する問題