jeudi 29 mai 2014

c# - version du Client de déterminer d'Application au démarrage - Stack Overflow


Problem:


We have a C# application, .Net 3.5 which is updated manually on client computers. Don't even ask, we can't do the one-click deploys.


When a new build is created and a client has not been updated, I would like to alert the client (on start-up) that the application is out of date and a new build must be obtained before proceeding.


I am interested in what approaches others may have used to solve the same problem (restricting clients from using old builds)


Thanks - Glenn




You need to create a web service which will return the current application version. The service must be installed where it is available for the clients to call.


Then you need to add a call to the service and check the running application version against the version from the service.




our application is connected to a DB and we ensure at the start up of the application that the version of the App matches the version recorded in the DB. If it does not match a message is displayed to the user. If your app does not connect to a DB I suppose it could talk to a WCF service to get whatever the latest version is. I have seen people simply retrieving a file from a shared drive and reading the value from it. This requires the shared UNC path to be available from all users which is not always convenient.




Are you using ClickOnce to distribute your application? If yes, you can specify minimum version required before publish it.


If no, you can manage versions of executable files and check it on startup. Something like:


Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;


Problem:


We have a C# application, .Net 3.5 which is updated manually on client computers. Don't even ask, we can't do the one-click deploys.


When a new build is created and a client has not been updated, I would like to alert the client (on start-up) that the application is out of date and a new build must be obtained before proceeding.


I am interested in what approaches others may have used to solve the same problem (restricting clients from using old builds)


Thanks - Glenn



You need to create a web service which will return the current application version. The service must be installed where it is available for the clients to call.


Then you need to add a call to the service and check the running application version against the version from the service.



our application is connected to a DB and we ensure at the start up of the application that the version of the App matches the version recorded in the DB. If it does not match a message is displayed to the user. If your app does not connect to a DB I suppose it could talk to a WCF service to get whatever the latest version is. I have seen people simply retrieving a file from a shared drive and reading the value from it. This requires the shared UNC path to be available from all users which is not always convenient.



Are you using ClickOnce to distribute your application? If yes, you can specify minimum version required before publish it.


If no, you can manage versions of executable files and check it on startup. Something like:


Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;

0 commentaires:

Enregistrer un commentaire