Skip to content

Instantly share code, notes, and snippets.

@vnisor
Forked from sneal/hwcdirect.md
Created October 17, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnisor/d64a1ac4f0a1c77639e2ff18dc581f9e to your computer and use it in GitHub Desktop.
Save vnisor/d64a1ac4f0a1c77639e2ff18dc581f9e to your computer and use it in GitHub Desktop.
How to run Cloud Foundry hwc.exe directly

How to run hwc.exe directly without CloudFoundry

When web applications are pushed to CloudFoundry they are pushed out to one or more Windows cells and run inside the Hostable Web Core (HWC). HWC is the same component that IIS uses underneath to do the heavy lifting of serving ASP.NET applications. In Cloud Foundry the HWC is bootstrapped by the command line hwc.exe which works much like IISExpress.

Setup

We're going to serve the PCF .NET Environment Viewer app locally using the hwc.exe. These steps will guide you through all the prereqs to get that app working.

  1. Install the following Windows features: Hostable Web Core, ASP.NET 4.6, Websockets.
  2. Download or build the hwc executable. Place the hwc.exe in c:\containerizer.
  3. Clone the PCF .NET Environment Viewer app to c:\containerizer\env i.e. git clone https://github.com/Pivotal-Field-Engineering/pcf-dotnet-environment-viewer.git env.
  4. From PowerShell start the web server: & { $env:PORT=8080; .\hwc.exe -appRootPath "C:\containerizer\env\ViewEnvironment\" }

You should now be able to browse to http://localhost:8080/ and even attach a debugger and set breakpoints to the hwc.exe process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment