C
C#2mo ago
kacperz

I can't find ASP.NET Core with React.js

Hello guys, I want to create ASP.NET Core with React.js because I want to follow Tutorial but in visual studio on my computer I can't find it. Should I install additional module? May somebody help me with that?(the first screenshot is from tutorial)
No description
No description
35 Replies
leowest
leowest2mo ago
No description
leowest
leowest2mo ago
that's the only one I see I wonder if there is missing templates
kacperz
kacperz2mo ago
I have it too but are they the same? Why haven't I template from the tutorial is it because of visual studio version?
No description
leowest
leowest2mo ago
what version of visual studio are u using? I suspect they were replace but im not sure
kacperz
kacperz2mo ago
It's Visual Studio Community 2022 v17.10.0
No description
leowest
leowest2mo ago
]
No description
leowest
leowest2mo ago
yeah I guess they replaced it and the new template sets everything up
kacperz
kacperz2mo ago
ok thank you but I have another issue when I am trying to compile this application this errors occure everytime
No description
leowest
leowest2mo ago
and if u do it from the console?
kacperz
kacperz2mo ago
how can i do that?
leowest
leowest2mo ago
u go to the folder where the csproj is and do dotnet build
kacperz
kacperz2mo ago
No description
kacperz
kacperz2mo ago
it's the same issue
leowest
leowest2mo ago
open the vs installer
No description
leowest
leowest2mo ago
and go to modify and check nodejs
leowest
leowest2mo ago
No description
kacperz
kacperz2mo ago
i have it downloaded
No description
leowest
leowest2mo ago
then on the previous window do a repair on visual studio
kacperz
kacperz2mo ago
ok this may take a few minutes
leowest
leowest2mo ago
aside from that everything works for me
kacperz
kacperz2mo ago
I repaired this but it stil doesn't work
No description
leowest
leowest2mo ago
it would have helped if the errors were in English and not as a image, I dont do web front end so this is as far as I can help u sorry. Maybe someone else can assist u
kacperz
kacperz2mo ago
ok thank you
Keswiik
Keswiik2mo ago
What version of nodejs are you using?
friedice
friedice2mo ago
what version of .net do you have installed?
Jimmacle
Jimmacle2mo ago
.NET 8 doesn't have templates that include SPAs just set up the SPA separately
kacperz
kacperz2mo ago
No description
kacperz
kacperz2mo ago
.net 8.0 how can i do it?
Jimmacle
Jimmacle2mo ago
follow the instructions for setting one up with vite/etc vite can proxy requests to your API project in development and for production you can serve the frontend files directly from the API
Keswiik
Keswiik2mo ago
do you need vite? As long as you set up the SPA stuff properly in your Startup it should be able to run fine
Jimmacle
Jimmacle2mo ago
what SPA stuff are you referring to? i haven't done this much myself but vite does stuff like HMR for hot reloading when you change the frontend source
Keswiik
Keswiik2mo ago
app.UseSpa(spa => {
spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment()) {
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
app.UseSpa(spa => {
spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment()) {
spa.UseReactDevelopmentServer(npmScript: "start");
}
});
Jimmacle
Jimmacle2mo ago
and what if you aren't using react :when:
Keswiik
Keswiik2mo ago
well this guy was trying to use react lol only reason I mentioned it
Jimmacle
Jimmacle2mo ago
i'm guessing that's specifically for CRA which to my understanding is hot garbage vite is a similar tool
Want results from more Discord servers?
Add your server
More Posts