i'm working on a federated identity scaffolding package for use in any asp.net project environment where ws-federation federated identity security has been enabled. This involves adding a boiler plate type implementaiotn
to App_Code and a bunch of boiler plate event handlers to Global.asax.cs.
In an effort to keep it separated from Global.asax.cs so as to better facilitate NuGet package install/update/uninstall what i really want/need is the ability to place it all in a Global.asax.FedId.cs and have that enabled by
modifying the original Global.asax.cs System.Web.HttpApplication derived type implementation to have “partial” inserted upon install and removed upon uninstall, e.g. in case of mvc3 project “public
class MvcApplication : System.Web.HttpApplication”
MvcApplication : System.Web.HttpApplication”.
Even better would be a story for having my NuGet package do that and in addition when adding the Content/Global.asax.FedId.cs source file to the csproj file it would be great if it was added as follows
<Compile Include="Global.asax.FedId.cs"><DependentUpon>Global.asax</DependentUpon></Compile> with the DependentUpon element so that you
get the expected vstudio solution view when looking for code behind files for Global.asax.
Note that I did investing trying to use [assembly: WebActivator.PostApplicationStartMethod(typeof(MvcApplication1.MvcApplication), "PostApplication_Start")]
as a way of enabling the federated identity handlers typically placed in Global.asax.cs but the windows identity foundation (wif) plumbing calls these events at interesting times and with/without certain related types initialized
and so wiring them up in WebActivator enabled Pre/PostApplication_Start isn’t helping me in this case.