你可以在运行一个函数时,使用C#控制台.NET程序进行更新。

huangapple go评论78阅读模式
英文:

How do I make my C# Console .NET program update when I run a function?

问题

这是 https://stackoverflow.com/questions/26222107/ 的重复问题。

我正在制作一个要在学校展示的项目。我不想一遍又一遍地下载新项目。我希望有一种方法可以在用户调用更新函数时更新C#控制台项目。有没有什么方法可以做到这一点?

我查看了以前的帖子中的一些方法,但它们看起来太复杂了。

英文:

This is a duplicate of https://stackoverflow.com/questions/26222107/

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

答案1

得分: 1

添加一个在编译时将文件复制到某个共享驱动器的后构建脚本,然后从该共享位置运行程序。这是迄今为止最简单的方法。

接下来的步骤是将构建后的文件添加到共享的Git存储库中,并在需要最新版本时运行拉取命令。你可以使用脚本来自动为每个构建推送新版本,但我认为最好手动执行此操作,以便在发布之前有机会测试更改。

或者使用一些远程桌面软件,仅在开发计算机上运行程序。

你可以使它变得更加复杂,包括更新服务器、一键安装等等,但我认为这不适合用于学校作业的小型实用工具。

英文:

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.

huangapple
  • 本文由 发表于 2023年6月29日 21:59:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76581755.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定