Astute readers would have noticed that when I started on my “class a day” journey that I missed out on the System._AppDomain interface and skipped straight to System.AccessViolationException. Thats because I am going to look at it when I look at the System.AppDomain class (notice the subtle difference there?) a little way down the track.
The ActivationContext class is a new addition to the .NET Framework in the 2.0 release and we have a quick look at the Callee Graph in Reflector we can see that it has something to do with ClickOnce deployment.
Basically, the ActivationContext is available to applications that have been deployed by ClickOnce and give those applications access to important information such as where the application came from. This information is loaded out of the application manifest which is part of the set of files that are deployed to a server in order to support ClickOnce.
Developers don’t actually get a whole heap of access to the application manifest information from the ActivationContext class because the really interesting methods are marked as internal as the picture below generated from Reflector shows.
One thing that I thought was pretty amusing in the above listing was the internal inner enum called ApplicationStateDisposition. Way back when I used to do technical support I used to tell people that computers are just a machine, and they don’t hate their users, no matter how much you think that file corruption is a personal slight against them. Well – it looks like I was wrong.
Anyway – I think that the ActivationContext class like many of the classes that deal with deployment in the .NET Framework will provide useful diagnostic information for support staff. So what I would do is display something like the ApplicationIdentity attached as a property to the ActivationContext in some part of an About box – although ClickOnce kinda does that for free.