1

This is a duplicate of How to automatically update a C# .Net console application?

I am making a project that I'm going to show at school. I don't feel like downloading the new projects over and over again. I would like a method to update the C# console project when the user invokes the update function. Any way I can do this?

I looked at some of the methods in the previous post, but they looked too complicated

01maxzie
  • 29
  • 8

1 Answers1

1

Add a post build script that copies the files to some shared drive whenever you compile. And run the program from that share. This is by far the simplest approach.

Next step up is to add the built files in a shared git repo and run a pull command whenever you want the latest version. You could use a script to automatically push a new version for each build, but I would argue that it would be better to do this manually, so you have some chance to test changes before publishing.

Or use some remote desktop software and only run the program on your development computer.

You can make it a whole more complicated, with update servers, click once, and other things, but I would not think that is suitable for some small utility for schoolwork.

JonasH
  • 28,608
  • 2
  • 10
  • 23
  • Same concept as first, but could have a startup .bat file to download latest from shared network drive right before running the app. Also, you could make use of a file sync service like DropBox or OneDrive to receive changes in a synched folder. – oglester Jun 29 '23 at 14:36
  • I want to ask, how would you run the GitHub commands? I looked around the internet and didn't find any reliable answers for running github commands. – 01maxzie Jun 30 '23 at 06:00
  • @01maxzie github is a hosting provider for git repos, but there are plenty of other ways to host git repos. You can use [git for windows](https://gitforwindows.org/) to interact with a git repo, regardless of hosting solution. Or use something with a UI, like [gitExt](http://gitextensions.github.io/), If you are a student it will be very useful to learn how to use source control software. – JonasH Jul 03 '23 at 14:55
  • Yes, but how would I use the GitHub REST API to check for new release and then download the new release? @JonasH – 01maxzie Jul 05 '23 at 06:44
  • @01maxzie the git pull command will check if there are any new commits, and if so, download them. – JonasH Jul 06 '23 at 07:15