You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 30, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+66-3Lines changed: 66 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,13 @@
1
-
# Integrating Angular CLI with dotnet in Visual Studio
1
+
# Hit The Ground Running
2
+
3
+
Clone repo.
4
+
5
+
`npm run setup`
6
+
7
+
Open solution in Visual Studio, choose either IIS Express or dotnet Kestrel and F5 or Ctrl-F5. Make a change and verify that the browser reloads with the change.
8
+
9
+
10
+
# Phases to integrate Angular CLI with dotnet in Visual Studio
2
11
3
12
## Phase 1
4
13
@@ -22,12 +31,66 @@ Make sure that you follow the instructions in this [article](https://blogs.msdn.
22
31
23
32
Open a command prompt to your project folder and type in `dotnet add package Microsoft.AspNetCore.StaticFiles`.
24
33
25
-
In Visual Studio open Startup.cs and remove the app.Run code inside the Configure section. Add `app.UseDefaultFiles(); app.UseStaticFiles();`
34
+
In Visual Studio open Startup.cs and remove the app.Run code inside the Configure section. Add
35
+
```
36
+
app.UseDefaultFiles();
37
+
app.UseStaticFiles();
38
+
```
26
39
27
40
Change the outDir in the angular-cli.json from dist to wwwroot.
28
41
29
42
Now when you build your solution in Visual Studio it will kick off ng serve and open a new browser window pointing to `http://localhost:4200/`.
30
43
31
44
## Phase 3
32
45
33
-
Coming up...
46
+
In this phase we are going to take over management of webpack and run everything through IIS Express or dotnet run.
47
+
48
+
Replace npm start script in package.json to original version.
49
+
50
+
Remove -vs-binding reference at bottom of package.json.
51
+
52
+
Open a command prompt to your project folder and type in `ng eject`.
53
+
54
+
Copy webpack.config.js, webpack.config.vendor.js and package.json from this [commit](https://github.com/calebcwells/angular-cli-visualstudio/tree/37a8a0ad31a63d01a399c574f8673c58d8c523f3).
55
+
56
+
Edit your proj file to include
57
+
```
58
+
<Target Name="AngularBuild" AfterTargets="Build">
59
+
<Exec Command="webpack" />
60
+
</Target>
61
+
```
62
+
63
+
In a command prompt in your project folder and type in `dotnet add package Microsoft.AspNetCore.SpaServices`.
0 commit comments