Last post Mar 19, 2018 12:54 PM by JAYHAWKER
Mar 17, 2018 03:57 PM|JAYHAWKER|LINK
I am trying to deploy a core 2 app to IIS on a production server (Windows Server 2012 R2), but also want to be able to edit and control the web.conf file that is automatically created when publishing the app. I have published it, but can't get it to run.
I did the following to try to get a Core 2 app running on the production server.
Added ".UseIISIntegration()" to the WebHost.CreateDefaultBuilder(args) in the program.cs file.
On IIS of the production server, I created a new Application pool choosing "No Managed Code" as the .Net CLR Version.
Published the app to the production server, but I get nothing, without errors, but it does not go to the default document and just loads the default IIS page.
What am I doing wrong?
Mar 19, 2018 08:31 AM|Brando ZWZ|LINK
As far as I know, the auto generated web config file is used to tell the iis to start the application from asp.net core module.
The config as below:
<?xml version="1.0" encoding="utf-8"?>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
<aspNetCore processPath="dotnet" arguments=".\Asp.netCoreTest.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
I suggest you could firstly check your application and make sure you have set the right route config.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
Besides, I guess you may not install the net core SDK on your server-side.
I suggest you could try to install it and run your application again.
Mar 19, 2018 12:54 PM|JAYHAWKER|LINK
I actually discovered that you can go ahead and create web.config file on the development side, and then it will automatically be used on the production server. It will only create it for IIS if it doesn't already exist.
Thanks for your efforts.