如何部署控制台应用程序

发布于 2024-08-15 13:46:45 字数 231 浏览 1 评论 0原文

我有一个控制台应用程序,当我运行(从 vs.net 内)时,需要一段时间,因为它是一个长时间运行的进程。

我想继续在 vs.net 中编码,甚至可能生成控制台应用程序的多个实例。

如何在我的台式计算机上最好地部署它?

这是一个好方法吗:

创建一个文件夹: /我的控制台/ 然后是每个实例的子文件夹。

我是否只获取 /debug 文件夹中的所有罚款,还是还有其他依赖项?

I have a console application, that when I run (from within vs.net) it takes a while as it is a long running process.

I want to continue coding in vs.net, and maybe even spawn multiple instances of the console application.

How to best deploy this on my desktop cmputer?

Is this a good approach:

create a folder:
/myConsole/
then subfolders for each instance.

Do I just grab all fines in the /debug folder or are there other dependancies?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

穿透光 2024-08-22 13:46:45

如果您在不附加调试器的情况下运行,则可以在程序运行时继续编码。

调试菜单|不调试启动,或Ctrl+F5

注意:使用此方法,您可以编译修改后的代码,但无法运行它,因为.exe 输出文件将被使用。我不确定这对你来说是否有问题。

If you run without attaching the debugger you can continue coding while the program runs.

Debug Menu | Start without debugging, or Ctrl+F5

Note: using this method, you can compile the modified code, but cannot run it since the .exe output file will be in use. I'm not sure if that's a problem for you.

红墙和绿瓦 2024-08-22 13:46:45

我之前做过的一种方法是从 VS 创建发布版本。然后在发布文件夹上根据需要打开任意数量的命令提示符,然后从那里运行它。然后我改回调试构建并继续编码。这让我可以运行单独的实例,并在需要时进行调试,这就像更改 VS 中的构建类型一样简单。

One way I've done it before is to create a release build from VS. Then open as many command prompts as you need on the release folder and then run it from there. Then I change back to debug build and continue coding. This lets me run the separate instances and also debug if need be and it's all as simple as changing the type of build in VS.

披肩女神 2024-08-22 13:46:45

您应该考虑在单元测试控制台(例如 Resharper 提供的控制台)中通过系统测试来执行代码。它为您进行卷影复制,并允许您很好地运行多个会话、启动/中止它们等。我认为这比在整个商店启动测试应用程序要干净和灵活得多。

You should consider executing your code through system tests in a unit test console like the one that Resharper offers. It does shadow copying for you and allows you to nicely run multiple sessions, start/abort them etc. I think this is far more clean and flexible than firing up test apps all over the shop.

把人绕傻吧 2024-08-22 13:46:45

如果您不需要附加调试器,那么只需转到 /bin 文件夹并双击 exe,按照您想要打开的实例的次数进行操作即可?

如果你确实需要附加调试器..那么我能想到的唯一方法是运行多个 VS 实例,每个实例都进行调试:S

If you dont need to have the debbuger attach, what about just going to your /bin folder and double clinking on the exe, as many times as instances you want open?

If you DO need to have the debugger attached.. then the only way I can think about it is to have multiple instances of VS running, each with the debugging on :S

瞄了个咪的 2024-08-22 13:46:45

一般来说,bin\debug 目录之外没有任何依赖项。如果您想在编码和重新编译时测试这个长时间运行的程序,您需要将 bin\debug 目录的内容复制到其他位置,然后从那里运行它。

是否可以从同一目录运行单独的实例取决于程序如何处理输出文件或其他资源。如果任何输出文件的名称是硬编码的,那么您将必须从单独的目录运行多个实例。如果您可以在命令行上指定文件,那么您可以在单个目录中运行任意数量的实例。

In general, there aren't any dependencies outside of your bin\debug directory. If you want to test this long-running program while you're still coding and re-compiling, you'll want to copy the contents of the bin\debug directory somewhere else, and run it from there.

Whether or not you can run separate instances from the same directory depends on how the program deals with output files or other resources. If the name of any output file is hard coded, then you'll have to run multiple instances from separate directories. If you can specify files on the command line, then you can run as many instances as you like from within a single directory.

冰之心 2024-08-22 13:46:45

您应该能够将控制台应用程序复制到单独的文件夹中。这将是构建文件夹中的所有文件。然后,您可以像任何其他 exe 一样运行它。如果您不共享应用程序文件夹中的设置/数据,则可以根据需要多次运行该应用程序。 Windows 非常乐意运行同一个 exe 的多个实例。

如果您想自动化,您可以在构建事件中将应用程序从构建文件夹中复制出来......

You should be able to copy your console application into a separate folder. This would be all the files in the build folder. Then, you can just run it like any other exe. If you are not sharing settings / data in the application folder, you can run the application as many times as you like. Windows is quite happy to run a number of instances of the same exe.

If you wanted to automate, you could copy the application out of the build folder in a build event...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文