.NET app fails to start: hostpolicy.dll and runtimeconfig.json missing (self-contained app not properly packaged)

Kemotkowy 0 Reputation points
2026-07-16T21:13:06.7633333+00:00

I am trying to run a third‑party .NET application (DBusWorld Launcher), but the executable fails immediately with the following error:

A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in the application directory.

Failed to run as a self-contained app.

  • The application was run as a self-contained app because '<appname>.runtimeconfig.json' was not found.
  • If this should be a framework-dependent app, add the runtimeconfig.json file and specify the appropriate framework.

My system is fully up to date:

  • Windows 11

.NET Runtime 8.0 installed

.NET Desktop Runtime 8.0 installed

ASP.NET Core Runtime 8.0 installed

.NET SDK 8.0.100 installed

Windows Update working normally

Other .NET applications run without issues.

The problem is that the DBusWorld Launcher is distributed only as a single .exe file with no:

hostfxr.dll

hostpolicy.dll

runtimeconfig.json

deps.json

or any other required .NET runtime files.

Because of this, the .NET host cannot determine the required framework and cannot start the application.

Is there any way to run such an application without the missing files, or is the publisher required to provide a properly packaged self‑contained or framework‑dependent build?

Developer technologies | .NET | .NET Runtime
0 comments No comments

2 answers

Sort by: Most helpful
  1. AI answer

    2026-07-16T21:13:41.11+00:00

    Yes. The publisher must provide a valid deployment.

    The error means the app is being treated as a self-contained app because <appname>.runtimeconfig.json is missing. Without that file, the .NET host cannot determine the target framework. If hostpolicy.dll is also missing from the application directory, the app cannot start as self-contained either.

    Supported paths are:

    1. Framework-dependent deployment
      • The app must include its .runtimeconfig.json so the host can identify the required framework.
      • The required compatible runtime must then be installed on the machine.
    2. Self-contained deployment
      • The publisher must publish the app with the .NET runtime included so the target machine does not need a separate runtime installation.

    Installing .NET Runtime, Desktop Runtime, ASP.NET Core Runtime, or the SDK on the machine does not fix a package that is missing its required deployment files. The app package itself must be correct.

    There is no supported way to make an arbitrary third-party .exe run when the required .runtimeconfig.json and self-contained host files were not provided. The practical resolution is for the publisher to redistribute the app as either:

    • a properly packaged framework-dependent app with .runtimeconfig.json, or
    • a properly packaged self-contained app that includes the runtime components.

    If the publisher intended a single-file deployment, that must be produced during publishing. A missing .runtimeconfig.json in a normal framework-dependent app causes the host to assume self-contained behavior, which then requires the self-contained files to be present.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.
  2. Danny Nguyen (WICLOUD CORPORATION) 7,675 Reputation points Microsoft External Staff Moderator
    2026-07-17T04:12:55.19+00:00

    Hi @Kemotkowy

    It looks like your current setup is missing some essential components required to run the application. Could you double-check if the .exe is truly the only file provided, or if there might be other files (like .dll or .json files) in the original download that were not extracted?

    In a standard framework-dependent deployment, the DBusWorldLauncher.exe file acts as a bootstrapper that looks for its main payload (DBusWorldLauncher.dll) and configuration instructions (DBusWorldLauncher.runtimeconfig.json). Because these companion files are missing, the .NET Host cannot determine how to start the program.

    If you confirm that the publisher only provided this single .exe, you can partially bypass the missing configuration error by manually creating a untimeconfig.json file. Assuming it is a Windows desktop application, it likely requires the Microsoft.WindowsDesktop.App framework.

    Create a text file in the exact same folder as DBusWorldLauncher.exe, name it DBusWorldLauncher.runtimeconfig.json, and paste the following content:

    {
      "runtimeOptions": {
        "tfm": "net8.0",
        "frameworks": [
          {
            "name": "Microsoft.NETCore.App",
            "version": "8.0.0"
          },
          {
            "name": "Microsoft.WindowsDesktop.App",
            "version": "8.0.0"
          }
        ]
      }
    }
    

    Note: While this bypasses the initial hostpolicy.dll error, the application will very likely crash right after if it is also missing the main DBusWorldLauncher.dll file and other dependencies. Ultimately, if the publisher intends to distribute a standalone executable without companion files, they would need to compile the application as a Single File Application (using <PublishSingleFile>true</PublishSingleFile>).

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.

    Thank you.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.