After setting up a new React-with-Redux template, I can successfully run the application in debug mode, but running the application after publishing fails:
Steps to reproduce:
dotnet new reactredux
dotnet publish -c Release -r win10-x64
Navigate to destination folder ([appDirectory]\bin\Release\netcoreapp2.1\win10-x64\publish\)
dotnet [appName].dll
Result:
User profile is available. Using 'C:\Users\[snip]\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.AspNetCore.SpaServices[0]
Starting create-react-app server on port 50445...
Hosting environment: Development
Content root path: [appDirectory]\bin\Release\netcoreapp2.1\win10-x64\publish
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
npmfail: Microsoft.AspNetCore.SpaServices[0]
npm ERR! path [appDirectory]\bin\Release\netcoreapp2.1\win10-x64\publish\ClientApp\package.json
fail: Microsoft.AspNetCore.SpaServices[0]
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '[appDirectory]\bin\Release\netcoreapp2.1\win10-x64\publish\ClientApp\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 7264db1b-55ec-e419-d2c4-bd4fe64922a2
* Version Independent ID: 720995d2-006a-3573-4868-d253c8a2acc7
* Content: [Use the React-with-Redux project template with ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/react-with-redux?view=aspnetcore-2.1)
* Content Source: [aspnetcore/client-side/spa/react-with-redux.md](https://github.com/aspnet/Docs/blob/master/aspnetcore/client-side/spa/react-with-redux.md)
* Product: **aspnet-core**
* GitHub Login: @SteveSandersonMS
* Microsoft Alias: **scaddie**
After setting up a new React-with-Redux template, I can successfully run the application in debug mode, but running the application after publishing fails:
Steps to reproduce:
dotnet new reactredux
dotnet publish -c Release -r win10-x64
[appDirectory]\bin\Release\netcoreapp2.1\win10-x64\publish\
)dotnet [appName].dll
Result: