Problem hosting nested apps from .NetCore and MVC in IIS

0

Step 1 - Have a running .Net Core app (with React as front end) in IIS on Windows Server.
Step 2 - Setup a MVC app within the Core app using 'Add Application' option in IIS. (Nested apps)

Note: AppPools of the 2 apps are different and point to appropriate Core/framework versions.

Result - When try to access the MVC app, get "HTTP Error 502.5 - Process Failure" error. From the logs in Event viewer, it appears the MVC app is trying to start the dll of the Core app and not MVC (message below).

Application 'MACHINE/WEBROOT/APPHOST/COREAPP/MVCAPP' with physical root 'PATH TO MVC APP' failed to start process with commandline 'dotnet .*COREAPP*.dll', ErrorCode = '0x80004005' : 80008091.

Believe the MVC app should somehow be forced to run in framework pointing to appropriate dll/startup file. Could someone point me in the right direction? Any thoughts would be appreciated!

Have below setting in MVC app's mvcapp.runtimeconfig.json file

{
  "runtimeOptions": {
    "framework": {
      "name": ".net framework",
      "version": "4.8"
    },
    "configProperties": {
      "System.GC.Server": true
    }
  }
}
asp.net-mvc
.net-core
iis-6
web-hosting
asked on Stack Overflow Nov 21, 2019 by Rajass • edited Nov 21, 2019 by Rajass

1 Answer

0

Got it working by forcing the parent app to NOT inherit it's config on to child app. Set the inheditChildApplication setting to false in parent config. In this case, I do not want any settings to be inherited to child, have to be cautious when wanting certain settings to be inherited.

<location path="." inheritInChildApplications="false">

<system.webServer>
     Settings goes here
</system.webServer>

</location>

answered on Stack Overflow Nov 25, 2019 by Rajass

User contributions licensed under CC BY-SA 3.0