HWC Buildpack

Page last updated:

Overview

This topic describes how to configure your .NET application for use with the HWC buildpack and how to push your .NET application to Cloud Foundry. HWC is a wrapper around Hosted Web Core API for running .NET Applications on Windows.

HWC Setup

HWC relies on Web.config configuration for hosting the .NET Applications.

Push Your App

Follow the steps below to push your application.

Step Action
1. Use the cf push APP_NAME command to push your app. Replace APP_NAME with the name you want to give your application. For example:
$ cf push my-app
Creating app my-app in org sample-org / space sample-space as username@example.com...
OK
…
requested state: started
instances: 1/1
usage: 1GB x 1 instances
urls: my-app.example.com
If you do not have the buildpack, or the installed version is out-of-date, use the -b option to specify the buildpack as follows:
cf push APP_NAME -b https://github.com/cloudfoundry/hwc-buildpack.git
2. Find the URL of your app in the output from the push command and navigate to it to see your HWC app running.

Features

Below are a set of features that can be used with HWC buildpack.

Context Path Routing

HWC-hosted apps use the VCAP_APPLICATION environment variable to read out the bound app URIs. Any context path that exists underneath the root in the app’s bound route corresponds to the applicationHost.config.

Run the following commands to define context path routing that makes app2 accessible under app1’s URL. e.g app1.example.com/app2:

$ cf push app1 #find the URL for your app1
$ cf push app2 --no-start --no-route
$ cf map-route app2 example.com --hostname app1 --path app2
$ cf start app2

Shadow Copy Setting

Shadow Copy is a hosting option that copies assemblies for an app in the bin directory to the app’s temporary files directory. This features is turned off and unnecessary for apps running under Cloud Foundry. An app can override this setting in its web.config file.

Buildpack Support

A number of channels exist where you can get more help when using the HWC buildpack, or with developing your own HWC buildpack.

  • HWC Buildpack Repository in Github: Find more information about using and extending the HWC buildpack in GitHub repository.

  • Release Notes: Find current information about this buildpack on the HWC buildpack release page in GitHub.

  • Slack: Join the #buildpacks channel in the Cloud Foundry Slack community.

Create a pull request or raise an issue on the source for this page in GitHub