Great question.
I can’t say exactly why this is so, but I think that maybe the application is “hosted” differently, as it is the “ClickOnce Application Deployment Support Library” that launches the application.
However, if you have an inexorable desire to use AppDomain.FriendlyName to distinguish your applications, then perhaps you could create an appdomain yourself and define your own friendly name.
Another idea that would serve the same purpose would be to use the full name of the application as follows:
private static string GetAppName()
{
if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment curDeployment = ApplicationDeployment.CurrentDeployment;
string fullname = curDeployment.UpdatedApplicationFullName;
Match match = Regex.Match(fullname, "#.+/(?<app>.+).exe");
return match.Groups["app"].ToString();
}
return null;
}
, . , : http://blogs.msdn.com/b/shawnfa/archive/2004/06/30/170241.aspx
- , .