There are things that frustrate me with Click Once security.
Suppose I have a simple application to deploy with click once, setting partial trust. I have an about box automatically generated with VS and then edited.
Still i want to keep the following:
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
Or hopefully I would like it changed to the deployment version (and not the assembly version). But I don't know how to do it.
If I keep the following code, I have the following problem: it demands me FileIO permission to run. But if we want to do something this simple and give our programs FileIO permissions like this, then the reason for isolated storage ceases to exist. What should I do Is there an alternative

Clickonce & Security
Jaden
I can definitely understand your frustrations..Sometimes even the simplest of the operations need a FileIO permissions. These cases may not be apparent by looking at just the function call..
I can suggest a work around for your GetName(). You get the DisplayName of the assembly and parse it to get the name. DisplayName can be obtained even in limited trust.
My suggestion for this kind of stuff is, you do the permission calculation before you publish the app. Use the cutom set of permission which VS determines and suggests you to have for your app to run smoothly. This is a better alternative if you don't want to give full trust and the per-defined permissionsets are too limited for you to do anything (useful)
-Sreekanth
MarcvdW
Can I find the display name with a similar way (by the reflection ) I'll check it. Thanks!
In any case, this doesn't solve the problem with the window that doesn't close :( .
renskemo
this code:
/// <summary>
/// Saves settings for the tab user has opened.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
this.settings.Save();
}
[where settings are private Roller.Properties.Settings settings = Roller.Properties.Settings.Default; containing only one int setting]
makes the application not being able to Close (!!) when I use not-trusted settings (it works perfectly in full trusted mode). I mean, the code enters the functions, hits "this.settings.Save", leaves the function and never enters FormClosed...
This happens when I change the selectedTab (it's data bound to the setting) and not if I don't touch it. In the appropriate config file the config has not this value saved.
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int SelectedTab {
get {
return ((int)(this["SelectedTab"]));
}
set {
this["SelectedTab"] = value;
}
}
^^ This is the code of the setting