We are using c# windows forms and just trying to get started with .net. I
want to do something that should be easy but I can't find any way to make it
work. We are using Click Once to publish to a network drive and I need to be
able to check if a program is the current version. Because the users can
choose to not download the latest version this may be a problem. I just want
to show what version they are running.
I found some code that gave me:
private void FrmMain_Load(object sender, EventArgs e)
{
FileVersionInfo fvi =
FileVersionInfo.GetVersionInfo(Application.Executa blePath);
string version = fvi.FileVersion.ToString();
MessageBox.Show(version);
}
I am not sure if this will give me what I need. And it also gets an error I
don't understand. Why would gettting the version number be a security
exception?
System.Security.SecurityException was unhandled
Message="Request failed."
Source="AfterSchool1"