Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

How to get this working in Visual Studio 2022 #1821

Closed
liamfoneill opened this issue Jan 10, 2022 · 6 comments
Closed

How to get this working in Visual Studio 2022 #1821

liamfoneill opened this issue Jan 10, 2022 · 6 comments

Comments

@liamfoneill
Copy link

In order to get this to work properly in Visual Studio 2022, in addition to following the instructions in the Wiki, I also needed to change the run configuration from the default of 'Debug' to 'Release'.

Running it in Debug mode seems to cause some error about SPA Middleware not being able to find index.html.

Please update the Wiki.

@ChinguunU
Copy link

Having the same issue

@nishanil
Copy link
Contributor

Thanks for reporting this. We are investigating this issue. From the initial look, it might be related to this one: dotnet/aspnetcore#5223 (comment)

@nishanil
Copy link
Contributor

@erjain Hey! I have tested what @liamfoneill recommends and it works well. Can you update the Wiki to set the run configuration to Release for WebSpa please ?
Thank You @liamfoneill for the suggestion !!

@erjain
Copy link
Contributor

erjain commented Feb 14, 2022

Thanks @nishanil for confirming the suggestion from @liamfoneill .
Also if we want to run the application in debug mode using Visual Studio 2022, we can follow the below steps (also updated in wiki):

  1. Update the Dockerfile in WebSPA project(src/Web/WebSPA/Dockerfile) to insert below instructions after WORKDIR /app

RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get -y install nodejs
RUN npm install
RUN npm -v

  1. Update the value for webspa.environment in docker-compose.override.yml as follows:
    ASPNETCORE_ENVIRONMENT=Development

@erjain
Copy link
Contributor

erjain commented Feb 17, 2022

I am closing this issue, however, feel free to continue the conversation or reopen it if you are looking for more help.

@wanaxe
Copy link

wanaxe commented May 11, 2023

Beside the above mentioned, I have to make below changes, to avoid RUN npm install error.

  • RUN npm install -g npm@9.5.1 to RUN npm install -g npm@9.6.6
  • RUN npm install to RUN npm install --legacy-peer-deps

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants