I have a .net core web api application, on localhost it was working fine both on iis express and default iis. On my web server, I want to host my application as a sub-app under a Asp.Net v4.0 application. I have created a sub application and deployed my core app, then created a no managed
app pool and chosen this app pool for my net core sub-app. I have fully installed .net core 2.0 windows hosting bundle and .net core 2.0 SDK.
Web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
StartUp
class' Configure
method
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory logger)
{
logger.AddFile(Configuration.GetValue<string>("LogPath"));
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
// Enable middleware to serve generated Swagger as a JSON endpoint.
app.UseSwagger();
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyAppV1");
});
app.UseMvc();
//app.UseMiddleware<LoggingMiddleWare>();
}
Program.cs
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
So when I call an endpoint from api, It returns 500 Internal server error.
Despite my stdoutlog is enabled, there is not any log file being created, can not see any proper event logs as well.