skip to Main Content

Using Visual Studio 2022, I’m trying to create a project with React and ASP.NET Core. But there is error when trying to create the project:

project type screenshot

This is the error:

error screenshot

I didn’t get the ASP.NET Core with React.js template.

2

Answers


  1. To create a project in Visual Studio 2022 that combines React.js and ASP.NET Core, you can follow these steps:

    1. Open Visual Studio 2022: Launch Visual Studio 2022 on your computer.

    2. Create New Project: Go to the "File" menu and select "New" > "Project…" or use the shortcut Ctrl + Shift + N.

    3. Choose Project Type: In the "Create a new project" window, navigate to "ASP.NET Core Web Application" in the "Web & Cloud" category. Select it and click "Next".

    4. Configure Project: In the next window, provide a name and location for your project. Click "Create".

    5. Select Project Template: In the "Create a new ASP.NET Core Web Application" window, choose "React.js" from the list of available templates. You might need to select the ASP.NET Core version you want to use. Click "Create" to continue.

    6. Configure React.js Options: You might be prompted to configure React.js options such as choosing the language (JavaScript or TypeScript) and selecting a CSS preprocessor (if applicable). Make your selections and click "Create" to proceed.

    7. Wait for Project Creation: Visual Studio will create your project and set up the necessary files and dependencies. This might take a few moments.

    8. Explore the Project Structure: Once the project is created, you’ll see the solution explorer with the project structure. You’ll typically have folders for client-side code (React.js), server-side code (ASP.NET Core), and shared resources.

    9. Start Coding: You can now start coding your React.js frontend and ASP.NET Core backend. Visual Studio provides various tools and features to help you develop and debug your application seamlessly.

    That’s it! You’ve successfully created a project in Visual Studio 2022 that combines React.js and ASP.NET Core.

    Login or Signup to reply.
  2. I didn’t get the ASP.NET Core with React.js template

    In order to get React and Asp.net core templete, you should have following prerequisite:

    1. Visual studio 2022 version 17.8 at least
    2. NPM installed on your machine
    3. Asp.net web development package

    enter image description here

    Once you installed above requirement, you should get this templete in visual studio search box: as following:

    enter image description here

    Now create your react app either with javascript or typescript: It should look as following:

    enter image description here

    Output:

    enter image description here

    enter image description here

    Note: If you still encounter any error, please refer to this official document.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search