MDrivenServerCore in IIS
No edit summary
No edit summary
Line 7: Line 7:
# Create new AppPool (only 1 app per pool), set AppPooll to "No managed code"
# Create new AppPool (only 1 app per pool), set AppPooll to "No managed code"
# Extract zip of installation into your site folder
# Extract zip of installation into your site folder
# Change the web.config '''or''' do this: better way is to follow this [[/wiki.mdriven.net/Injecting the Core server command line parameters via file|Injecting the Core server command line parameters v]]<nowiki/>[[/wiki.mdriven.net/Injecting the Core server command line parameters via file|ia file]]<nowiki/>and leave the web.config unchanged):
# Change this line in the web.config  
  <aspNetCore processPath=".\AppCompleteGenericCore.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" '''arguments="-iis=<nowiki>https://localhost/mdrCore1</nowiki>"''' />  SET THE URL YOUR APP SHOULD USE
  <aspNetCore processPath=".\AppCompleteGenericCore.exe" stdoutLogEnabled<nowiki/>="false<nowiki/>" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" '''arguments="-iis=<nowiki>https://localhost/mdrCore1</nowiki>"''' />  SET THE URL YOUR APP SHOULD USE
'''or''' '''even better''', follow this instruction: [[Injecting the Core server command line parameters via file]] and leave the web.config unchanged:
 
Complete web.config:
Complete web.config:
<pre>
<pre>

Revision as of 21:05, 10 January 2024

Note: These principles also work for MDrivenTurnkeyCore in IIS.

Microsoft article on installing .net core on IIS: https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-8.0&tabs=visual-studio

To host .net core in IIS:

  1. Install runtime-aspnetcore-7.0.<latest>-windows-hosting-bundle-installer. Please note that it should be version 7
  2. Create new AppPool (only 1 app per pool), set AppPooll to "No managed code"
  3. Extract zip of installation into your site folder
  4. Change this line in the web.config
<aspNetCore processPath=".\AppCompleteGenericCore.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" arguments="-iis=https://localhost/mdrCore1" />  SET THE URL YOUR APP SHOULD USE

or even better, follow this instruction: Injecting the Core server command line parameters via file and leave the web.config unchanged:

Complete web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\AppCompleteGenericCore.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" arguments="-iis=https://localhost/MDRDebug"  />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 3F248237-FF1B-4F4B-9029-DB6440643978-->

When you want to debug from VS - set argument -iis=https://localhost/mdrcore1/ or the name you have, stop AppPool, compile, then start AppPool and app - navigate via browser.

Turnkey core in IIS

The Turnkey core can also be hosted in IIS. In its Web.config, point out its target URL just like for MDrivenServer Core. Also, add an MDrivenServerOverride.xml file in its App_Data so that your MDrivenServer may be found.

Both MDrivenServer Core, and TurnkeyServer Core

See also: Injecting the Core server command line parameters via file

This page was edited 16 days ago on 04/13/2024. What links here