Search code examples
.netasp.nethttpapplication

Possible to use HttpApplication state in a .NET console app?


I need to quickly write a test console app for testing purposes.

This app is basically the console version of an ASP.NET app.

The original ASP.NET app makes use of the global Application object for storing global data.

How can I get the same functionality of the Application object in my console app? Can I declare an HttpApplication object directly and use it?

NOTE - this app is just for debugging some issues, not production code, so I'm ok if it's not "best practice".


Solution

  • You could just declare a static Dictionary<string, object> in your Program class