2

I'm using the React template in Visual Studio, and I'm now trying to deploy it to IIS.

My IIS looks like this:

enter image description here

The application pool look like this:

enter image description here

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?

5
  • Npm has nothing to do here. Basically npm is only used to compile client side reactjs Commented Nov 11, 2019 at 10:08
  • @Sameer so what is happening? Because if i run dotnet ICOM.Breif.UI.dll in cmd, and goes to localhost:5124, it works. Commented Nov 11, 2019 at 10:09
  • have you installed .net core hosting bundle on your machine? Commented Nov 11, 2019 at 10:17
  • @Sameer yes, im hosting other .net core projects. Commented Nov 11, 2019 at 10:20
  • Could you please tell us your IIS version? Which asp.net core application version you have used now? Which deploy-mode you have selected? Framework-Dependent or Self-contained? Commented Nov 12, 2019 at 2:22

2 Answers 2

3

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

  1. In VS, open package.json (in your React App folder - if you used VS template to create the project - it will be called ClientApp)

  2. On top of the file, under "name", "version" or "private" add new item, called "homepage"

  3. for "homepage" value, put "/[YOUR_APP_NAME_IN_IIS]" (forward slash) followed by name of your application exactly as you have it in IIS.

  4. Deploy

ReactRedux with .Net Core in IIS not working

It should render now:

working IIS react-redux .net core vs template

Hope this helps someone

Sign up to request clarification or add additional context in comments.

Comments

0

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.