✅ Trouble publishing .NET Core Web backend with React.js Frontend
I'm running into some issues building my .net core web api with react frontend. Building and running in development works fine, but I can't seem to create a prod build.
Here's what I've done so far:
On VS Code I run "dotnet publish -c Release -o published" and then "dotnet published/{projectName}.dll" to try to run it. The server starts running, but it doesn't build/run the React.js frontend with the proxy like in development ("dotnet watch run").
On Visual Studio, I right click the solution and hit "Publish to folder". Unfortunately, I keep getting "npm command not found". I've checked my terminal and confirmed that npm is installed. Any ideas why this is happening?
Any help would be very much appreciated.
9 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I am unable to unfortunately as this is for work. As for the template, I followed this tutorial https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-react?view=vs-2022.
Create an ASP.NET Core app with React - Visual Studio (Windows)
In this tutorial, you create an app using ASP.NET Core and React
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I have found the issue. It's a https issue. I need to generate a self-signed cert.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I got a self-signed cert working for my published build for localhost. Isn't that good enough for now while I'm developing?
Basically I'll get a legit cert from a trusted CA when I'm ready to deploy. What do you think?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'm having trouble getting port 443 working for dev though. What do you mean by it already exists in dev? Looks like for dev it's still unsecure
can I just share my screen?
I'm at casual-vc-1
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View