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/javascript/tutorial-asp-net-core-with-react.md
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ You can use the method described in this article to create ASP.NET Core Single P
34
34
35
35
Make sure to install the following:
36
36
37
-
- Visual Studio 2022 version 17.5 or later with the **ASP.NET and web development** workload installed. Go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) page to install it for free.
37
+
- Visual Studio 2022 version 17.7 or later with the **ASP.NET and web development** workload installed. Go to the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) page to install it for free.
38
38
If you need to install the workload and already have Visual Studio, go to **Tools** > **Get Tools and Features...**, which opens the Visual Studio Installer. Choose the **ASP.NET and web development** workload, then choose **Modify**.
39
39
- npm ([https://www.npmjs.com/](https://www.npmjs.com/package/npm)), which is included with Node.js
@@ -152,7 +152,7 @@ Starting in Visual Studio 2022 version 17.3, you can publish the integrated solu
152
152
You may see the following error:
153
153
154
154
```cmd
155
-
[HPM] Error occurred while trying to proxy request /weatherforecast from localhost:4200 to https://localhost:5001 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
155
+
[HPM] Error occurred while trying to proxy request /weatherforecast from localhost:4200 to https://localhost:7183 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
156
156
```
157
157
158
158
If you see this issue, most likely the frontend started before the backend. Once you see the backend command prompt up and running, just refresh the React App in the browser.
@@ -161,16 +161,26 @@ If you see this issue, most likely the frontend started before the backend. Once
161
161
162
162
If the weather data does not load correctly, you may also need to verify that your ports are correct.
163
163
164
-
1. Make sure that the port numbers match. Go to the *launchSettings.json* file in your ASP.NET Core project (in the *Properties* folder). Get the port number from the `applicationUrl` property.
164
+
1. Make sure that the port numbers match. Go to the *launchSettings.json* file in your ASP.NET Core project (in the *Properties* folder). Get the port number from the `url` property.
165
165
166
-
If there are multiple `applicationUrl` properties, look for one using an `https` endpoint. It should look similar to `https://localhost:7049`.
166
+
If there are multiple `url` properties, look for one using an `https` endpoint. It should look similar to `https://localhost:5173`.
167
167
168
-
1. Then, go to the *setupProxy.js* file for your React project (look in the *src* folder). Update the target property to match the `applicationUrl` property in *launchSettings.json*. When you update it, that value should look similar to this:
168
+
1. Then, go to the *vite.config.js* file for your React project (look in the *src* folder). Update the `port` property to match the `url` property in *launchSettings.json*. When you update it, that value should look similar to this:
169
169
170
170
```js
171
-
target:'https://localhost:7049',
171
+
port:5173,
172
172
```
173
173
174
+
### Privacy error
175
+
176
+
You may see the following certificate error:
177
+
178
+
```
179
+
Your connection isn't private
180
+
```
181
+
182
+
Try deleting the React certificates from *%appdata%\local\asp.net\https* or *%appdata%\roaming\asp.net\https*, and then retry.
183
+
174
184
## Next steps
175
185
176
186
For more information about SPA applications in ASP.NET Core, see the React 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*, *aspnetcore-react.js*, and *setupProxy.js*, although details of the implementation are different based on the template differences. For example, instead of a ClientApp folder, the React files are contained in a separate project.
Copy file name to clipboardExpand all lines: docs/javascript/tutorial-asp-net-core-with-vue.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -165,18 +165,16 @@ Try deleting the Vue certificates from *%appdata%\local\asp.net\https* or *%appd
165
165
166
166
If the weather data does not load correctly, you may also need to verify that your ports are correct.
167
167
168
-
1. Make sure that the port numbers match. Go to the *launchSettings.json* file in your ASP.NET Core project (in the *Properties* folder). Get the port number from the `url`or `applicationUrl`property.
168
+
1. Make sure that the port numbers match. Go to the *launchSettings.json* file in your ASP.NET Core project (in the *Properties* folder). Get the port number from the `url` property.
169
169
170
-
If there are multiple `url`or `applicationUrl`properties, look for one using an `https` endpoint. It should look similar to `https://localhost:5173`.
170
+
If there are multiple `url` properties, look for one using an `https` endpoint. It should look similar to `https://localhost:5173`.
171
171
172
-
1. Then, go to the *vite.config.js* file for your Vue project. Update the url or target property to match the `url` or `applicationUrl` property in *launchSettings.json*. When you update it, that value should look similar to this:
172
+
1. Then, go to the *vite.config.js* file for your Vue project. Update the `port`property to match the `url` property in *launchSettings.json*. When you update it, that value should look similar to this:
173
173
174
174
```js
175
-
url:'https://localhost:5173',
175
+
port:5173,
176
176
```
177
177
178
-
or:
179
-
180
178
### Outdated version of Vue
181
179
182
180
If you see the console message **Could not find the file 'C:\Users\Me\source\repos\vueprojectname\package.json'** when you create the project, you may need to update your version of the Vite CLI. After you update the Vite CLI, you may also need to delete the *.vuerc* file in *C:\Users\\[yourprofilename\]*.
0 commit comments