I'm using the React template in Visual Studio, and I'm now trying to deploy it to IIS.
My IIS looks like this:
The application pool look like this:
After I've published the files to IIS, and I go to the url, nothing happens. When I hit Manage Application->Browse in IIS, nothing happens.
I can use the application if I go to the ClienApp folder in the project, open cmd, and writes dotnet ICON.Breif.UI.dll
, then the projects starts.
So I guess it has something to do with the node server when I publish to IIS?
Here's what did the trick for me, got a hint from HERE (apparently this is a known issue). Not the most flexible solution, but it works
In VS, open package.json (in your React App folder - if you used VS template to create the project - it will be called ClientApp)
On top of the file, under "name", "version" or "private" add new item, called "homepage"
for "homepage" value, put "/[YOUR_APP_NAME_IN_IIS]" (forward slash) followed by name of your application exactly as you have it in IIS.
It should render now:
Hope this helps someone
It depends on which version of asp.net core your using, currently I don't which version, if your using asp.net core version 3.0 then: please follow the link: Link: https://dotnetdetail.net/deploy-react-and-asp-net-core-3-0-application-to-iis/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.