ASP.NET Core - Troubleshooting

This topic will provide details regarding ASP.NET Core support for domains on our Shared Windows-based services.

.Net Core Versions

Currently our Shared Windows based servers support the following versions of the ASP.Net Core services:

  • ASP.Net Core 1
  • ASP.Net Core 2

.Net Core on Shared Hosting

In some cases, deploying an ASP.Net Core application to a shared hosting server you can run into unexpected errors which were not present when testing the same application in your development environment. If you do run begin experiencing error when deploying your application to a shared host, the following details can help you detect and resolve the cause of the error(s).

Enabling Detailed Error Logging

First, unlike traditional ASP and ASP.Net applications, ASP.Net Core applications will not display a detailed error page to the visitor when an issue is encountered. In this case to get additional details from a error in a ASP.Net Core application, you will need to enable the application's **"STDOUT"** logging, which will write detailed errors to a folder\file specified in the application's **"Web.Config"** configuration file.

Overall, enabling “STDOUT” logging can be done via the following steps:


  1. Using FTP or the WCP FileManager, navigate * ASP.Net Core application’s root directory on the domain.
  2. Create a folder called “logs” under the applications root directory (if not already present).
  3. Edit the application’s web.config file, focusing on the following elements:
    • Make sure that the “stdoutLogEnabled” setting is set to True.
    • Make sure that the “stdoutLogFile” setting is set to specify a file name under the “log” folder.
    • EXAMPLE:
    aspNetCore processPath="PLACE-HOLDER" arguments="PLACE-HOLDER" stdoutLogEnabled="True" 
    stdoutLogFile=".\logs\Application_Error.log" />
    
  4. Save the updated web.config file.
  5. Navigate to your site’s ASP.Net Core application. To populate the error log.
  6. Using FTP or the WCP FileManager, navigate to the logs folder, and open the most recent log file.

Disabling Detailed Error logging

After you are finished troubleshooting your application, you will need to disable STDLOG collections, as continued collections of logs on a live site can cause your site’s file usage to expand quickly and uncontrollably, which could lead to site availability issues.

Overall, disabling “STDOUT” logging can be done via the following steps:


  1. Using FTP or the WCP FileManager, navigate * ASP.Net Core application’s root directory on the domain.
  2. Edit the application’s web.config file, focusing on the following elements:
  • Make sure that the “stdoutLogEnabled” setting is set to False.

  • EXAMPLE:

    <aspNetCore processPath="PLACE-HOLDER" arguments="PLACE-HOLDER" stdoutLogEnabled="False" 
    stdoutLogFile=".\logs\Application_Error.log" />
    
  1. Save the updated web.config file.

Common Errors and Solutions

This Section will list some common errors that are encountered with ASP.Net Core applications.

"Error: An assembly specified in the application dependencies manifest was not found"

In the some cases after **enabling STDOUT Logging** you may find that your application is throwing an error similar to the following:

Error:An assembly specified in the application dependencies manifest (PLACEHOLDER-Assembly Name) was not found:
package: ‘PLACEHOLDER-Package Details’
path: ‘PLACEHOLDER-Path Details’

This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:PLACEHOLDER-File Name

In these cases, the error is indicating that your site’s ASP.Net Core application is set up to utilize the Implicit Package Store, which assumes that any and all target assemblies used by your application are already available in the Shared Host’s server-wide .NET Package Store.

The underlying principle of the Implicit Package Store is that your application will assume that the target server will already have access to the libraries and assemblies included in your project so as to avoid publishing your application with a redundant copy of these assets. However, in order to guarantee that your application has all of the necessary packages \ assemblies the Implicit Package Store option will need to be disabled.

Overall to resolve the error above, adding the following to your application’s project file will disable the Implicit Package Store and cause your application to provide a set of all dependent packages \ assemblies it among its files once published.

<PropertyGroup>
  <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>