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
Copy file name to clipboardExpand all lines: docs/azure/overview.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,8 @@ Data providers are making services available via standard protocols, such as ODa
89
89
90
90
ASP.NET Core provides a comprehensive solution for simple web sites and complex web applications. Azure services can help address many of the needs and solve many of the challenges that arise in web site and web application development. ASP.NET Core web applications frequently use client-side JavaScript.
91
91
92
+
:::image type="content" source="./media/overview-azure-integration/scalable-ecommerce-web-app.png" alt-text="Diagram of web application example architecture." lightbox="./media/overview-azure-integration/scalable-ecommerce-web-app-high-res.png" :::
93
+
92
94
### Connect to Azure Cache for Redis
93
95
94
96
Azure Cache for Redis provides an in-memory data store for Azure services, web sites, and web applications. You can use Azure Cache for Redis as a distributed data or content cache, a session store, a message broker, and more. Supported scenarios include:
Copy file name to clipboardExpand all lines: docs/javascript/tutorial-asp-net-core-with-angular.md
+30-26Lines changed: 30 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create an ASP.NET Core app with Angular"
3
3
description: In this tutorial, you create an app using ASP.NET Core and Angular
4
-
ms.date: 04/25/2023
4
+
ms.date: 10/16/2023
5
5
ms.topic: tutorial
6
6
ms.devlang: javascript
7
7
author: mikejo5000
@@ -18,7 +18,7 @@ monikerRange: '>= vs-2022'
18
18
19
19
In this article, you learn how to build an ASP.NET Core project to act as an API backend and an Angular project to act as the UI.
20
20
21
-
Currently, Visual Studio includes ASP.NET Core Single Page Application (SPA) templates that support Angular and React. The templates provide a built-in Client App folder in your ASP.NET Core projects that contains the base files and folders of each framework.
21
+
Visual Studio includes ASP.NET Core Single Page Application (SPA) templates that support Angular and React. The templates provide a built-in Client App folder in your ASP.NET Core projects that contains the base files and folders of each framework.
22
22
23
23
You can use the method described in this article to create ASP.NET Core Single Page Applications that:
24
24
@@ -43,13 +43,13 @@ Make sure to install the following:
43
43
44
44
1. Search for Angular in the search bar at the top and then select **Angular and ASP.NET Core (Preview)**.
45
45
46
-
:::image type="content" source="media/vs-2022/angular-choose-template.png" alt-text="Screenshot showing choosing a template":::
46
+
:::image type="content" source="media/vs-2022/angular-choose-template.png" alt-text="Screenshot showing choosing a template.":::
47
47
48
-
1.Give your project and solution a name, and choose **Create**.
48
+
1.Name the project **AngularWithASP**and then choose **Create**.
49
49
50
-
Once the project is created, Solution Explorer should look like this:
Compared to the [standalone Angular template](../javascript/tutorial-create-angular-app.md), you see some new and modified files for integration with ASP.NET Core:
55
55
@@ -62,30 +62,30 @@ Make sure to install the following:
62
62
63
63
## Set the project properties
64
64
65
-
1. In Solution Explorer, right-click the ASP.NET Core project and choose **Properties**.
65
+
1. In Solution Explorer, right-click the **AngularWithASP.Server** project and choose **Properties**.
66
66
67
-
:::image type="content" source="media/vs-2022/asp-net-core-project-properties.png" alt-text="Screenshot showing Open project properties":::
67
+
:::image type="content" source="media/vs-2022/asp-net-core-project-properties-angular.png" alt-text="Screenshot showing Open project properties.":::
68
68
69
-
1. In the Properties page, open the **Debug** tab and select **Open debug launch profiles UI** option. Uncheck the **Launch Browser** option.
69
+
1. In the Properties page, open the **Debug** tab and select **Open debug launch profiles UI** option. Uncheck the **Launch Browser** option for the profile named after the ASP.NET Core project (or https, if present).
This prevents opening the web page with the source weather data.
73
+
This value prevents opening the web page with the source weather data.
74
74
75
75
>[!NOTE]
76
-
> In Visual Studio, *launch.json* stores the startup settings associated with the **Start** button in the Debug toolbar. Currently, *launch.json* must be located under the *.vscode* folder.
76
+
> In Visual Studio, *launch.json* stores the startup settings associated with the **Start** button in the Debug toolbar. *launch.json* must be located under the *.vscode* folder.
77
77
78
78
## Start the project
79
79
80
-
To start the project, press **F5** or select the **Start** button at the top of the window. You see two command prompts appear:
80
+
Press **F5** or select the **Start** button at the top of the window to start the app. Two command prompts appear:
81
81
82
82
- The ASP.NET Core API project running
83
83
- The Angular CLI running the ng start command
84
84
85
85
>[!NOTE]
86
-
> Check console output for messages, such as a message instructing you to update your version of Node.js.
86
+
> Check console output for messages. For example there might be a message to update Node.js.
87
87
88
-
You see an Angular app appear, populated using the API. If you don't see the app, see [Troubleshooting](#troubleshooting).
88
+
The Angular app appears and is populated via the API. If you don't see the app, see [Troubleshooting](#troubleshooting).
89
89
90
90
## Publish the project
91
91
@@ -94,25 +94,29 @@ Starting in Visual Studio 2022 version 17.3, you can publish the integrated solu
94
94
>[!NOTE]
95
95
> To use publish, create your JavaScript project using Visual Studio 2022 version 17.3 or later.
96
96
97
-
1. In Solution Explorer, right-click the ASP.NET Core project and choose**Add** > **Project Reference**.
97
+
1. In Solution Explorer, right-click the **AngularWithASP.Server**project and select**Add** > **Project Reference**.
98
98
99
-
1. Select the Angular project and choose **OK**.
99
+
The **angularwithasp.client*** project is selected.
100
100
101
-
1. Right-click the ASP.NET Core project in Solution Explorer and choose **Unload Project**.
101
+
1. Choose **OK**.
102
+
103
+
1. Right-click the ASP.NET Core project again and select **Edit Project File**.
102
104
103
105
This opens the *.csproj* file for the project.
104
106
107
+
Notice the `<ReferenceOutputAssembly>` has the value set to `false`.
108
+
105
109
1. In the *.csproj* file, update the project reference and add `<ReferenceOutputAssembly>` with the value set to `false`.
106
110
107
-
When you've updated the reference, it should look like this (substituting your own project folder and project name).
111
+
When you've updated the reference, it should look like the following.
1. Right.click the ASP.NET Core project and choose **Reload Project**.
119
+
1. Right-click the ASP.NET Core project and choose **Reload Project**.
116
120
117
121
1. In *Program.cs*, update the check for `Environment.IsDevelopment` so it looks like the following.
118
122
@@ -130,7 +134,7 @@ Starting in Visual Studio 2022 version 17.3, you can publish the integrated solu
130
134
}
131
135
```
132
136
133
-
1. To publish, right click the ASP.NET Core project, choose **Publish**, and select options to match your desired publish scenario, such as Azure, publish to a folder, et al.
137
+
1. To publish, right click the ASP.NET Core project, choose **Publish**, and select options to match your desired publish scenario, such as Azure, publish to a folder, etc.
134
138
135
139
The publish process takes more time than it does for just an ASP.NET Core project, since the `npm run build` command gets invoked when publishing.
136
140
@@ -150,7 +154,7 @@ If you see this issue, most likely the frontend started before the backend. Once
150
154
151
155
### Verify port
152
156
153
-
If the weather data does not load correctly, you may also need to verify that your ports are correct.
157
+
If the weather data doesn't load correctly, you may also need to verify that your ports are correct.
154
158
155
159
1. Go to the *launchSettings.json* file in your ASP.NET Core project (in the *Properties* folder). Get the port number from the `applicationUrl` property.
156
160
@@ -164,4 +168,4 @@ If the weather data does not load correctly, you may also need to verify that yo
164
168
165
169
## Next steps
166
170
167
-
For more information about SPA applications in ASP.NET Core, see the Angular section under [Developing Single Page Apps](/aspnet/core/client-side/spa/intro#developing-single-page-apps). The linked article provides additional context for project files such as *aspnetcore-https.js* and *proxy.conf.js*, although details of the implementation are different due to project template differences. For example, instead of a ClientApp folder, the Angular files are contained in a separate project.
171
+
For more information about SPA applications in ASP.NET Core, see the Angular section under [Developing Single Page Apps](/aspnet/core/client-side/spa/intro#developing-single-page-apps). The linked article provides additional context for project files such as *aspnetcore-https.js* and *proxy.conf.js*, although details of the implementation are different due to project template differences. For example, instead of a ClientApp folder, the Angular files are contained in a separate project.
0 commit comments