Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Following are some common errors that might occur with the Tsplice web API:

...

Expand

...

titleASP.NET Core app fails to start due to CryptographicException

Symptoms

When trying to request some data from the Tsplice API, an error message is returned to the client:

HTTP Error 500.30 - ASP.NET Core app failed to start

and the Windows Application event log shows a message like the following:

Code Block
Application: w3wp.exe
CoreCLR Version: 8.0.123.58001
.NET Version: 8.0.1
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
   at System.Security.Cryptography.CapiHelper.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
   at System.Security.Cryptography.RSACryptoServiceProvider.get_SafeProvHandle()
   at System.Security.Cryptography.RSACryptoServiceProvider.get_SafeKeyHandle()
   at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 keySize, CspParameters parameters, Boolean useDefaultKeySize)
   at TPRI.Tsecurity.SigningKey.Load() in d:\tpriNtRt\std\Projects\TPRI.Tsecurity\SigningKey.cs:line 30
   at TspliceWebApi.Program.Main(String[] args) in d:\tpriNtRt\std\Projects\TspliceApi\Program.cs:line 27

Explanation

This error occurs because the web server’s application pool’s Load User Profile setting is set to False.

Resolution

Follow the instructions at Installation Requirements to fix the Load User Profile setting. See also https://stackoverflow.com/q/17840825.

Expand
titleASP.NET Core app fails to start due to Negotiate Authentication handler

Symptoms

When trying to request some data from the Tsplice API, an error message is returned to the client:

HTTP Error 500.30 - ASP.NET Core app failed to start

and the Windows Application event log shows a message like the following:

Code Block
Category: Microsoft.AspNetCore.Hosting.Diagnostics
EventId: 6

Application startup exception

Exception: 
System.InvalidOperationException: The Negotiate Authentication handler cannot be used on a server that directly supports Windows Authentication. Enable Windows Authentication for the server and the Negotiate Authentication handler will defer to it.
   at Microsoft.AspNetCore.Authentication.Negotiate.PostConfigureNegotiateOptions.PostConfigure(String name, NegotiateOptions options)
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd[TArg](String name, Func`3 createOptions, TArg factoryArgument)
   at Microsoft.Extensions.Options.OptionsMonitor`1.Get(String name)
   at Microsoft.AspNetCore.Authentication.Negotiate.Internal.NegotiateOptionsValidationStartupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)

Explanation

This error occurs because Windows Authentication is disabled in the web server application’s Authentication settings.

Resolution

Follow the instructions at Installation Requirements to fix the Windows Authentication setting.

Expand
titleNotFound error while downloading application files from host

Symptoms

Texplore fails to connect to a custom application on a host, and displaying the error details shows a very long error message that begins like the following:

image-20240916-165525.pngImage Added

Further down in the error message, it indicates “The request filtering module is configured to deny the file extension”:

image-20240916-165632.pngImage Added

Explanation

By default, Internet Information Services includes a Request Filtering module that prevents the download of certain file types based on their extension, and this typically includes .config files. However, custom applications that utilize Texplore’s automatic download functionality to copy files down to the client system typically include one or more .config files in the \HmiConfig\ folder. When Texplore tries to download these files, IIS returns a 404 NotFound error.

Resolution

Confirm the %TSENTRY_SYSDIR%\tpriNtRt\wwwroot\web.config file includes the tags that clear all file extensions from the request filtering module as shown below:

Code Block
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  ...
  <system.webServer>
    <security>
      <requestFiltering>
         <fileExtensions>
            <clear />
         </fileExtensions>
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Alternatively, Request Filtering can be disabled for the website as follows:

  • Click on the Request Filtering module for the target website

    • image-20240916-170737.pngImage Added
  • Right-click on the .config File Extension and choose Remove

    • image-20240916-171005.pngImage Added