0

I have website created under IIS 10 named MyWeb that runs under port 5000. I need to create an application under it, to host a .NET 6 and I need this app to listen to port 6000, can this be done?

My goal is to host a NextJS app and a .NET 6 app under the same site, so the NextJS will run at 5000 and .NET at 6000.

Hasan Shouman
  • 2,162
  • 1
  • 20
  • 26
  • Port number is part of a site binding. So, to let an application under a site to handle requests at a specific port, the site must have a binding with that port. – Lex Li Jul 27 '23 at 18:52
  • @LexLi How can I make this specific binding loads the app and not the site? – Hasan Shouman Jul 28 '23 at 05:34

2 Answers2

0

If your website named MyWeb is bound to port 5000, all applications created under this site will be accessed through port 5000. You need to create two sites binding port 5000 and port 6000 respectively to host NextJS application and .NET 6 application.

YurongDai
  • 1,362
  • 1
  • 2
  • 7
  • In visual studio there is a template to create React app with .NET 6 and they are hosted under the same site. Do you have know how to configure this for NextJS? – Hasan Shouman Jul 28 '23 at 05:35
  • Visual Studio did not have a built-in template for creating a Next.js app with .NET 6 under the same site. – YurongDai Jul 28 '23 at 09:55
0

I have been searching for a while and I came up with some conclusions, thanks to you:

  • SSR can not be used in this case.
  • VS has no template for this.
  • We can use SSG, check this :https://github.com/NetCoreTemplates/nextjs but this will use serviceStack.net. There is a tool named "x" on the NuGet website, that is used to setup the template.
Hasan Shouman
  • 2,162
  • 1
  • 20
  • 26